Z
Zoury
Hi there! :O)
I need to replace all the accentued character of a string by it's
non-accentued-character equivalent.
1. is there a way to do so without iterating trought the entire string and
replacing character, with the Convert or Encoding class for example?
2. if not, how can you actually replace a specific character in a string
without recreating a new string?
for now I do something like..
//***
string s = "aaaa ccaaa c aaa ca aaa";
char[] chars = s.ToCharArray();
for (int i = 0; i < chars.Length; i++)
{
if (chars == 'c')
{
chars = 'x';
}
s = new string(chars);
}
//***
this is seems to be the lighter way we've found to do it... :O/
I would done something like this but it's not possible instead but the
compiler is complaining about the indexer being read-only..... (wich is
poor..)
//***
string s = "aaaa ccaaa c aaa ca aaa";
for (int i = 0; i < s.Lenght; i++)
{
if (s == 'c')
{
s = 'x';
}
}
//***
and I am **not** looking for the Replace() function...
thanks for the help..
I need to replace all the accentued character of a string by it's
non-accentued-character equivalent.
1. is there a way to do so without iterating trought the entire string and
replacing character, with the Convert or Encoding class for example?
2. if not, how can you actually replace a specific character in a string
without recreating a new string?
for now I do something like..
//***
string s = "aaaa ccaaa c aaa ca aaa";
char[] chars = s.ToCharArray();
for (int i = 0; i < chars.Length; i++)
{
if (chars == 'c')
{
chars = 'x';
}
s = new string(chars);
}
//***
this is seems to be the lighter way we've found to do it... :O/
I would done something like this but it's not possible instead but the
compiler is complaining about the indexer being read-only..... (wich is
poor..)
//***
string s = "aaaa ccaaa c aaa ca aaa";
for (int i = 0; i < s.Lenght; i++)
{
if (s == 'c')
{
s = 'x';
}
}
//***
and I am **not** looking for the Replace() function...
thanks for the help..