Skip to content

Commit 6041098

Browse files
[doc] Add example to bad strip call (#6093)
So it's easier to understand what strip does without reading the documentation
1 parent 03a115e commit 6041098

2 files changed

Lines changed: 8 additions & 4 deletions

File tree

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
1-
my_string = "Hello World"
2-
my_string.strip("Hello") # [bad-str-strip-call]
1+
"Hello World".strip("Hello") # [bad-str-strip-call]
2+
# >>> ' World'
3+
"abcbc def bacabc".strip("abcbc ") # [bad-str-strip-call]
4+
# >>> 'def'
Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
1-
my_string = "Hello World"
2-
my_string.strip("Helo")
1+
"Hello World".strip("Helo")
2+
# >>> ' World'
3+
"abcbc def bacabc".strip("abc ")
4+
# >>> 'def'

0 commit comments

Comments
 (0)