diff options
-rw-r--r-- | docs/markdown/Syntax.md | 4 | ||||
-rw-r--r-- | docs/yaml/elementary/str.yml | 8 |
2 files changed, 8 insertions, 4 deletions
diff --git a/docs/markdown/Syntax.md b/docs/markdown/Syntax.md index f63125e..9958db5 100644 --- a/docs/markdown/Syntax.md +++ b/docs/markdown/Syntax.md @@ -252,13 +252,13 @@ s = s.replace('as', 'are') #### .strip() ```meson -# Similar to the Python str.strip(). Removes leading/ending spaces and newlines +# Similar to the Python str.strip(). Removes leading/ending spaces and newlines. define = ' -Dsomedefine ' stripped_define = define.strip() # 'stripped_define' now has the value '-Dsomedefine' # You may also pass a string to strip, which specifies the set of characters to -# be removed. +# be removed instead of the default whitespace. string = 'xyxHelloxyx'.strip('xy') # 'string' now has the value 'Hello' ``` diff --git a/docs/yaml/elementary/str.yml b/docs/yaml/elementary/str.yml index dca6382..7c48c5d 100644 --- a/docs/yaml/elementary/str.yml +++ b/docs/yaml/elementary/str.yml @@ -61,7 +61,10 @@ methods: # str.strip() - name: strip - description: Removes leading/ending spaces and newlines from the string. + description: | + Removes leading/ending characters from the string. + + By default the characters to remove are spaces and newlines. returns: str example: | ```meson @@ -75,7 +78,8 @@ methods: strip_chars: type: str since: 0.43.0 - description: All characters in this string will be stripped. + description: + description: Instead of whitespace, strip all the characters in this string. # str.to_lower() - name: to_lower |