From 0e21bc8408c03cd2f66aca117fe44627eb73885c Mon Sep 17 00:00:00 2001 From: flaviut Date: Fri, 20 Jun 2014 17:38:16 -0400 Subject: [PATCH] Add strings --- content/types/primitive_data_structures.md | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/content/types/primitive_data_structures.md b/content/types/primitive_data_structures.md index 00379b4..8ebee09 100644 --- a/content/types/primitive_data_structures.md +++ b/content/types/primitive_data_structures.md @@ -12,11 +12,11 @@ echo "words words words ⚑" echo """ - \n\n + \n\n - - """ + + """ proc re(s: string): string = s @@ -37,8 +37,11 @@ words words words ⚑ \b[a-z]++\b ``` -There are several things to note about strings: +There are several types of strings literals: - Quoted Strings: Created by wrapping the body in triple quotes, they never interpret escape codes - Raw Strings: created by prefixing the string with an `r`. Escape sequences don't work, except for `"`, which can be escaped as `""` - - Proc Strings: raw strings, but the method name that prefixes the string is called \ No newline at end of file + - Proc Strings: raw strings, but the method name that prefixes the string is called + +### A note about unicode +Unicode symbols are allowed in strings, but are not treated in any special way, so if you want count glyphs or uppercase unicode symbols, you must use the `unicode` module. However, because all unicode characters are above 127, you can safely pretend you are not using unicode. \ No newline at end of file