examples/string/escape.ck
raw| 1 | // escape sequences |
| 2 | |
| 3 | // newline |
| 4 | <<< "line1\nline2", "\n" >>>; |
| 5 | |
| 6 | // tab |
| 7 | <<< "a\tb", "\n" >>>; |
| 8 | |
| 9 | // audible bell (uh...) |
| 10 | <<< "bell!\a", "\n" >>>; |
| 11 | |
| 12 | // " |
| 13 | <<< "->\"<-", "\n" >>>; |
| 14 | |
| 15 | // end of string |
| 16 | <<< "here\0can't see me", "\n" >>>; |
| 17 | |
| 18 | // wait a bit |
| 19 | 200::ms => now; |
| 20 | |
| 21 | // octal (man ascii) |
| 22 | <<< "bell!\007\060---\061\012", "" >>>; |