import re


def slice(text, length=100, offset = 0, last_word=True):
	"""
	Slice a string.
	"""
	text = text[offset:]
	if len(text) <= length or not last_word:
		return text[:length]
	return re.sub('(\s+\S+\s*)$', '', text[:length])