Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
2-liner solution in Creative category for Cut Sentence by przemyslaw.daniel
def cut_sentence(string, length, s=__import__('re').search):
return s(r'.{,%s}\b' % length, string).group().rstrip()+'...'*(len(string) > length)
July 9, 2017