aboutsummaryrefslogtreecommitdiff
path: root/docs/markdown/snippets
diff options
context:
space:
mode:
authorTristan Partin <tristan@partin.io>2021-03-07 22:59:21 -0600
committerXavier Claessens <xclaesse@gmail.com>2021-03-09 06:27:58 -0500
commitc83106ee38048acbe737ef112e8d51c9b5bd42d7 (patch)
tree7d2edd54b8d98e6c65f9f20291721070e5207e3e /docs/markdown/snippets
parent487eef29076670385928ee10bc7f462ffa890af6 (diff)
downloadmeson-c83106ee38048acbe737ef112e8d51c9b5bd42d7.zip
meson-c83106ee38048acbe737ef112e8d51c9b5bd42d7.tar.gz
meson-c83106ee38048acbe737ef112e8d51c9b5bd42d7.tar.bz2
Add str.replace() method
Diffstat (limited to 'docs/markdown/snippets')
-rw-r--r--docs/markdown/snippets/string_replace.md10
1 files changed, 10 insertions, 0 deletions
diff --git a/docs/markdown/snippets/string_replace.md b/docs/markdown/snippets/string_replace.md
new file mode 100644
index 0000000..e88179d
--- /dev/null
+++ b/docs/markdown/snippets/string_replace.md
@@ -0,0 +1,10 @@
+## String `.replace()`
+
+String objects now have a method called replace for replacing all instances of a
+substring in a string with another.
+
+```meson
+s = 'aaabbb'
+s = s.replace('aaa', 'bbb')
+# 's' is now 'bbbbbb'
+```