C# Tip. To make sure you clean your string from non ASCII characters you can use Regex class instead of using string functions. The [\x01-\x1F] is the range you want to keep.temp = Regex.Replace(temp, "[\x01-\x1F]", ""); Happy coding.Read more: Al Pascual