I have the following string
"Messatsu Gou Hadou (滅殺豪波動)"
Is there a way to escape these characters so it would be converted to
"滅殺豪波動"
Is there some way to do it?
I have the following string
"Messatsu Gou Hadou (滅殺豪波動)"
Is there a way to escape these characters so it would be converted to
"滅殺豪波動"
Is there some way to do it?
You could write a function like this:
public static string EscapeString(string s)
{
StringBuilder sb = new StringBuilder();
foreach (char c in s)
{
int i = (int)c;
if (i < 32 || i > 126)
{
sb.AppendFormat("&#{0};", i);
}
else
{
sb.Append(c);
}
}
return sb.ToString();
}