3 lines
118 B
Python
3 lines
118 B
Python
def truncate(string: str, length: int) -> str:
|
|
return string[: length - 2] + ".." if len(string) > 52 else string
|