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:
Code | Output |
---|---|
' | single quote |
" | double quote |
\ | backslash |
\n | newline |
\r | carriage return |
\t | tab |
\b | backspace |
\f | form feed |
By understanding and using these escape sequences, you can more easily manage and manipulate strings in your code.
No comments:
Post a Comment