I would like to 开发者_Go百科replace the french letter Æ with the asci corresponding AE, but the method does not accept this. Is there another way?
How about:
myString.Replace("Æ", "AE");
Instead of string.Replace('Æ','AE')
, use string.Replace("Æ", "AE")
.
This doesn't work?
string x = "ÆHELLO";
string y = x.Replace("Æ", "AE");
Just call .ToString()
on your char:
var str = str.Replace('Æ'.ToString(), "AE");
This should work since it is a valid Unicode character - are you sure you are re-assigning the string? strings are immutable so this is necessary:
string test = "Æblah";
test = test.Replace("Æ", "AE");//test is now "AEblah"
精彩评论