aboutsummaryrefslogtreecommitdiff
path: root/docs/markdown/Syntax.md
diff options
context:
space:
mode:
Diffstat (limited to 'docs/markdown/Syntax.md')
-rw-r--r--docs/markdown/Syntax.md12
1 files changed, 12 insertions, 0 deletions
diff --git a/docs/markdown/Syntax.md b/docs/markdown/Syntax.md
index e3a70c7..33b06cb 100644
--- a/docs/markdown/Syntax.md
+++ b/docs/markdown/Syntax.md
@@ -178,6 +178,18 @@ These are raw strings that do not support the escape sequences listed
above. These strings can also be combined with the string formatting
functionality described below.
+### String index
+
+Stings support the indexing (`[<num>]`) operator. This operator allows (read
+only) acessing a specific character. The returned value is guaranteed to be
+a string of length 1.
+
+```meson
+foo = 'abcd'
+message(foo[1]) # Will print 'b'
+foo[2] = 'C' # ERROR: Meson objects are immutable!
+```
+
### String formatting
#### .format()