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 1ee65c6 commit 12c74a2Copy full SHA for 12c74a2
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