Skip to content

Commit 4e67ccf

Browse files
committed
2 parents c5ad310 + 6820579 commit 4e67ccf

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

handy-stuff-strings.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,10 @@ True
177177
True
178178
>>> our_string.endswith('world!') # Python is case-sensitive
179179
False
180+
>>> our_string.replace('World', 'there')
181+
'Hello there!'
182+
>>> our_string.replace('l', 'ł', 1) # only replace one l
183+
'Hełlo World!'
180184
>>> ' hello 123 '.lstrip() # left strip
181185
'hello 123 '
182186
>>> ' hello 123 '.rstrip() # right strip

0 commit comments

Comments
 (0)