aboutsummaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorEli Schwartz <eschwartz@archlinux.org>2023-07-28 12:11:42 -0400
committerEli Schwartz <eschwartz@archlinux.org>2023-07-28 12:13:42 -0400
commit1b8dcbcc5782a7809d23d5bff1baeb5fee74068e (patch)
treea4a53cdb1eaa6057e1ed666b601390f2fe8dccf6 /docs
parent9eb7fe332f6a6a8babd040b76ad2a6808faf0423 (diff)
downloadmeson-1b8dcbcc5782a7809d23d5bff1baeb5fee74068e.zip
meson-1b8dcbcc5782a7809d23d5bff1baeb5fee74068e.tar.gz
meson-1b8dcbcc5782a7809d23d5bff1baeb5fee74068e.tar.bz2
docs: clarify what str.split does
The wording was a bit confusing and misled at least one person into thinking it behaved like `str.replace('c', '')` operating on the entire line. Tweak the wording to be more precise and avoid this confusion.
Diffstat (limited to 'docs')
-rw-r--r--docs/markdown/Syntax.md4
-rw-r--r--docs/yaml/elementary/str.yml8
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