Soldato
- Joined
- 27 Mar 2003
- Posts
- 2,710
Hi Guys,
just wondering what the best way is for removing/ stripping out unicode characters. The reason I ask is that it is causing some issues with saving information in a particular way.
Currently I am using this code:
char[] stringconvertor = new char[TextBox1.Text.Length];
string returnstring = "";
stringconvertor = TextBox1.Text.ToCharArray();
for(int loop = 0;loop < TextBox1.Text.Length;loop++)
{
if (stringconvertor[loop] <= 127)
{
returnstring = returnstring+ stringconvertor[loop].ToString();
}
}
TextBox2.Text = returnstring;
now I have found that running this code it takes around 4 minutes to go through about 200,000 characters which is obviously unacceptable for users so is there a better way.
just wondering what the best way is for removing/ stripping out unicode characters. The reason I ask is that it is causing some issues with saving information in a particular way.
Currently I am using this code:
char[] stringconvertor = new char[TextBox1.Text.Length];
string returnstring = "";
stringconvertor = TextBox1.Text.ToCharArray();
for(int loop = 0;loop < TextBox1.Text.Length;loop++)
{
if (stringconvertor[loop] <= 127)
{
returnstring = returnstring+ stringconvertor[loop].ToString();
}
}
TextBox2.Text = returnstring;
now I have found that running this code it takes around 4 minutes to go through about 200,000 characters which is obviously unacceptable for users so is there a better way.