This repository has been archived on 2024-07-04. You can view files and clone it, but cannot push or open issues or pull requests.
worblehat-old/python/util.py

5 lines
147 B
Python
Raw Normal View History

def cut_str(string, length, ellipsis='...'):
if len(string) < length:
return string
return string[0:length-len(ellipsis)]+ellipsis