Replace umlauts
C#
4
Posts
3
Posters
0
Views
1
Watching
-
Could anyone tell me why this doesn't work: string st = "ä"; st.Replace("ä", "ae"); Console.WriteLine(st); //output: ä What is going on?
-
string.Replace() is a method with a string return value. Try this
st = st.Replace("a", "ae");
- Arcond
-
Hi, strings are immutable, this means nothing can change their value; the only thing you can do is create a new string, and that's what this method does for you. :)
Luc Pattyn [Forum Guidelines] [My Articles]
this weeks tips: - make Visual display line numbers: Tools/Options/TextEditor/... - show exceptions with ToString() to see all information - before you ask a question here, search CodeProject, then Google