We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 43bc31a commit 8dfbf8bCopy full SHA for 8dfbf8b
snippets/python/string-manipulation/truncate.md
@@ -8,7 +8,7 @@ tags: string,truncate
8
9
```py
10
def truncate(s:str, length:int, suffix:bool = True) -> str :
11
- return (s[:length] + ("…" if suffix else "")) if len(s) > length else s
+ return (s[:length] + ("…" if suffix else "")) if len(s) > length else s
12
13
# Usage:
14
truncate('This is a long string', 10) # Returns: 'This is a …'
0 commit comments