django-utils v0.3.0 documentation

This Page


A collection of utilities for dealing with strings.

djutils.utils.strings.split_words_at(words, split_at, after=True)

Split the words string at a certain number of characters

  • words – an arbitrary string to truncate
  • split_at – number of characters to treat as the boundary
  • after – whether to break up string before or after the boundary


>>> split_words_at('aa bb cc dd', 4, True)
'aa bb'
>>> split_words_at('aa bb cc dd', 4, False)

Remove all instances of stop words from text. Stop words are defined in djutils.constants