each loop on String does not work in newer ruby versions.