什么是垂直制表符、换页符和退格符?如何在 JavaScript 中使用它们?
我想知道什么是垂直制表符、换页符和退格符以及如何在JavaScript中使用它们?或者我有机会(应该)使用它们吗?
I want to know what is vertical tab, form feeds and backspace character and how to use them in JavaScript? Or is there any chance I have to(should) use them?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
\v
= U+000b\f
= U+ 000c\b
= U+0008这些转义序列的定义可能是因为所有其他 C 派生语言都有它们。一般来说,您不需要使用它们,它们也不会对文本产生有用的影响。
\v
= U+000b\f
= U+000c\b
= U+0008These escape sequences are defined probably because all other C-derived languages have them. Generally you won't need to use them, nor they will have useful effects on the text.
我将尝试通过示例使解释尽可能简单:
\f 或 FormFeed,前进到下一行并省略上一行中的字符数
\r 或 Return Carriage 将转到当前行的开头并打印字符
console.log(myString);
输出:
I will try to make the explanation as easy as possible with an example:
\f or FormFeed, with advance to the next line and omit the number of characters in the previous line
\r or Return Carriage will go to the start of the current line and print characters
console.log(myString);
Output: