program which finds the first non-repeated character in a string