File size: 218 Bytes
b4f3ba3
 
 
 
 
b40f434
 
 
1
2
3
4
5
6
7
8
9

def clip_text(t, lenght = 4):
    t_sub = t.replace("...", "dotdotdot")
    t_clipped = ".".join(t_sub.split(".")[:lenght]) + "."
    t_reverted = t_clipped.replace("dotdotdot", "...")
    return t_reverted