Processes strings using loops and indexes.