Some characters have special meaning inside Go string literals. To include them as regular characters, we escape them with a backslash (\).
For example, a double quote inside a double-quoted string must be written as \":
fmt.Println("I'll study \"Coding 101\" on AlgoCademy")
Common escape sequences include:
\"for a double quote inside a string\nfor a new line\\for a literal backslash
fmt.Println("I will learn this\nNo matter what")
fmt.Println("C:\\Users\\Andy\\notion")
Assignment
Follow the Coding Tutorial and practice escaping quotes, newlines, and backslashes.
Free plan: 30 tutor messages. PRO is unlimited.
Saved
Ctrl + Enter to check
