Function reference¶
Assertions¶
-
stringutils.
contains
(string, matches)[source]¶ Determine if a string contains any of the given values. matches may be a single string, or a list of strings.
Case conversion¶
All functions which convert to programming case formats accept strings in any of the other formats.
-
stringutils.
dashed_case
(string)[source]¶ Convert a string identifier to
dashed-case
. If the string is insnake_case
, capitalization of words will be preserved.
Lists¶
-
stringutils.
join
(strings, sep=', ', insertend=False)[source]¶ Concatenate a list of strings into a single string by a separating delimiter. If insertend is given and true, the delimiter is also included at the end of the string.
-
stringutils.
lines
(string, keepends=False)[source]¶ Split a string into a list of strings at newline characters. Unless keepends is given and true, the resulting strings do not have newlines included.
-
stringutils.
split_identifier
(string)[source]¶ Split a string identifier into a list of its subparts.
-
stringutils.
words
(string)[source]¶ Split a string into a list of words, which were delimited by one or more whitespace characters.