Moved StringUtil functions only used in CodeGenerator to that class.