Sync substring code example and discussion.

Substring code example has 4 uses of substring but the discussion
refers to only 3.
Merge pull request #505 from rsese/sync-substring-example

Sync substring code example and discussion.