Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
re.sub(ver.2) solution in Clear category for Cut Sentence by kurosawa4434
from re import sub
def cut_sentence(line, length):
if len(line) > length:
return sub(' *[^ ]*$', '...', line[:length+1])
else:
return line
July 7, 2017
Comments: