请注意,此方案在循环中使用正则表达式检测字符串尾部的字符是否空格,尽管使用正则表达式增加了一点性能负担,但它允许你根据浏览器定义空格字符列表,以保持简短和兼容性。
Although using a regex for this adds a bit of performance overhead, it lets you defer the list of whitespace characters to the browser for the sake of brevity and compatibility.
交之前你最好检查一下你是否已经把所有的空格都填写好了。
You'd better check whether you have filled out all the blanks before you hand it in.
用户经常不确定是否应该在邮编中包含一个空格。
Users often are not sure if they should include a space in a postcode.
应用推荐