Skip to content

Commit 8fae9bd

Browse files
kana800BethanyG
authored andcommitted
grammar correction and reference links
1 parent 005cbc1 commit 8fae9bd

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

concepts/string-methods/about.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ Just the place for a Snark! I have said it thrice:
119119

120120
Python `3.9` introduces two new string methods that make removing prefixes and suffixes much easier.
121121

122-
[`<str>.removeprefix(<substring>)`](https://docs.python.org/3.9/library/stdtypes.html#str.removeprefix) return the string without the prefix (`string[len(<substring>):]`), if the `<substring>` isn't present it will return a copy of the original string.
122+
[`<str>.removeprefix(<substring>)`][removeprefix] returns the string without the prefix (`string[len(<substring>):]`). If the `<substring>` isn't present, a copy of the original string will be returned.
123123

124124
```python
125125
# removing a prefix
@@ -129,7 +129,7 @@ Python `3.9` introduces two new string methods that make removing prefixes and s
129129
'bookkeeper'
130130
```
131131

132-
[`<str>.removesuffix(<substring>)`](https://docs.python.org/3.9/library/stdtypes.html#str.removesuffix) return the string without the suffix (`string[:-len(substring)]`), if the `<substring>` isn't present it will return a copy of the original string.
132+
[`<str>.removesuffix(<substring>)`][removesuffix] returns the string without the suffix (`string[:-len(substring)]`). If the `<substring>` isn't present, a copy of the original string will be returned.
133133

134134
```python
135135
# removing a suffix
@@ -159,3 +159,7 @@ Python also supports regular expressions via the `re` module, which will be cove
159159
[str-title]: https://docs.python.org/3/library/stdtypes.html#str.title
160160
[text sequence]: https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str
161161
[unicode code points]: https://stackoverflow.com/questions/27331819/whats-the-difference-between-a-character-a-code-point-a-glyph-and-a-grapheme
162+
163+
[removeprefix]: https://docs.python.org/3.9/library/stdtypes.html#str.removeprefix
164+
[removesuffix]: https://docs.python.org/3.9/library/stdtypes.html#str.removesuffix
165+

0 commit comments

Comments
 (0)