+ 1

Need examples of using special characters in the string - javascript

In JS, can you give an example of using \r \b \f and \\ inside a text string; or write a line for these special characters please. "I\'m a js learner."

1st Nov 2018, 2:32 AM
Annie Ha
2 Réponses
+ 2
\r is carriage return use on Windows pc for display new carriage return line, it normally works together with \n. e.g. \r\n \b is backspace, not really useful for displaying in string, however in regex, \b means word boundary. \f is form feed, normally use in printing for advancing to new printing page. \\ for displaying '\' character.
1st Nov 2018, 2:47 AM
Calviղ
Calviղ - avatar
0
arh... thanks so much for your explanation, will try it in the pc...
2nd Nov 2018, 6:20 AM
Annie Ha