VMI,
It's a little tedious, but why not just use the Substring method to
return the appropriate sections of the string. You can find the index of
the character, then replace it? Then, you can concatenate all of the
sections together.
For example.
// The old string.
string oldString = "Héllo";
// The new string.
string newString = oldString.Substring(0, 1) + "e" + oldString.Substring(2);
Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)
VMI said:
If I have the string "Héllo", how can I replace char[1] (é) with an 'e'?
I cannot use the String.Replace() fuction. It has to be by replacing one
char with another.
Thanks.