...

/

Iterating Over Strings

Iterating Over Strings

This lesson teaches us how to iterate over strings.

The following methods describe three different ways of traversing a String:

Tokenizing a String Object

A String object can be tokenized on whitespace or a character token.

Tokenizing to Separate on Whitespaces

split_whitespace is used to split a String on the occurrence of whitespace. Loop through the String to split on whitespaces using a for loop.

Syntax

The ...