记住在这个表达式的两侧使用引号使参数和嵌入空格保持在一起,如清单2后部所示。
Remember to use quotes around this expression to keep parameters with embedded Spaces together as you saw back in Listing 2.
拖拉和投入操作将会变更消息之间空格的数量,而不保持消息的顺序。
The drag-and-drop action will change the amount of space between the messages but preserve the order of the messages.
为了保持完整的文件名(请记住,UNIX参数以空格分隔),一定要使用find - print0和xargs -0。
To preserve an entire file name (remember, UNIX arguments are separated by white space), be sure to use find -print0 and its companion, xargs -0.
在行首留空格是另一个保持原有格式的方法。
请注意,此方案在循环中使用正则表达式检测字符串尾部的字符是否空格,尽管使用正则表达式增加了一点性能负担,但它允许你根据浏览器定义空格字符列表,以保持简短和兼容性。
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.
请注意,此方案在循环中使用正则表达式检测字符串尾部的字符是否空格,尽管使用正则表达式增加了一点性能负担,但它允许你根据浏览器定义空格字符列表,以保持简短和兼容性。
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.
应用推荐