how to iterate correctly through a string with conditionals statements

String members are characters $a and not strings themselves.

hjh