Skip to content

Commit

Permalink
doc: document string.{,l,r}strip parameter (google#196)
Browse files Browse the repository at this point in the history
  • Loading branch information
adonovan authored May 3, 2019
1 parent daf30b6 commit 854ab5f
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions doc/spec.md
Original file line number Diff line number Diff line change
Expand Up @@ -3831,8 +3831,12 @@ are strings.
`S.lstrip()` returns a copy of the string S with leading whitespace removed.
Like `strip`, it accepts an optional string parameter that specifies an
alternative set of Unicode code points to remove.
```python
" hello ".lstrip() # " hello"
" hello ".lstrip("h o") # "ell "
```
<a id='string·partition'></a>
Expand Down Expand Up @@ -3916,8 +3920,13 @@ rightmost splits.
`S.rstrip()` returns a copy of the string S with trailing whitespace removed.
Like `strip`, it accepts an optional string parameter that specifies an
alternative set of Unicode code points to remove.
```python
" hello ".rstrip() # "hello "
" hello ".rstrip() # "hello "
" hello ".rstrip("h o") # " hell"
```
<a id='string·split'></a>
Expand Down Expand Up @@ -4035,8 +4044,13 @@ function reports whether any one of them is a prefix.
`S.strip()` returns a copy of the string S with leading and trailing whitespace removed.
It accepts an optional string argument:
`S.strip(cutset)` instead removes all leading
and trailing Unicode code points contained in `cutset`.
```python
" hello ".strip() # "hello"
" hello ".strip("h o") # "ell"
```
<a id='string·title'></a>
Expand Down

0 comments on commit 854ab5f

Please sign in to comment.