Two of the most useful methods on strings involve lists of strings. The split method breaks a string into a list of words. By default, any number of whitespace characters is considered a word boundary.
An optional argument called a delimiter can be used to specify which characters to use as word boundaries. The following example uses the string ai as the delimiter:
The inverse of the split method is join. You choose a desired separator string, (often called the glue) and join the list with the glue between each of the elements.