Changed the StringToChar function to a class