hamster-tools/hamstertools/utils.py
2023-11-04 00:01:53 +00:00

3 lines
118 B
Python

def truncate(string: str, length: int) -> str:
return string[: length - 2] + ".." if len(string) > 52 else string