Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
1-liner solution in Creative category for Cut Sentence by martin_b
cut_sentence = lambda l, n: l[:max(0, l[:n].rfind(' ')) if l[n:n + 1] != ' ' else n] + '...' if len(l) > n else l
Nov. 19, 2017
Comments: