Skip to main content

Command Palette

Search for a command to run...

Day 4: Escape Sequence Values

Published
1 min read
\n -  A newline character
\t - A tab character
\" - A double Quotation marks
\\ - A backslash

Sample Code:

"Hello, \n Go"

Output: 
Hello
Go

"Hello, \t Go" 

Output:
Hello,  Go

"Quotes:, \"\""

Output:
Quotes: ""

"Backslash: \\"

Output:
Backslash: \

Runes:

Whereas strings are usually used to represent a whole series of text characters, Go’s runes are used to represent single characters.

String literals are written surrounded by double quotation marks ("), but rune literals are written with single quotation marks (').

ASCII Values:

image.png