Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
Just slightly better than veky's solution :) solution in Clear category for Cut Sentence by oduvan
import textwrap
def cut_sentence(original, width):
if len(original) <= width:
return original
return textwrap.shorten(original, width,
placeholder='', break_long_words=False) + '...'
July 26, 2017
Comments: