Tuesday, May 28, 2024

Escape Sequences in Strings

   
Escape Sequences in Strings

Escape sequences are special characters used within strings to represent certain characters that are otherwise difficult to include. Here is a table of common escape sequences and their outputs:

CodeOutput
'single quote
"double quote
\backslash
\nnewline
\rcarriage return
\ttab
\bbackspace
\fform feed

By understanding and using these escape sequences, you can more easily manage and manipulate strings in your code.

No comments:

Post a Comment