It can be replaced with a string of characters in the other character, it can be nested, as follows:
It should be noted that it can be replaced with a blank character, but can not replace the null character, when uncertain whether the string is empty, you can make the following judgment, then replace:
Complete code sample:
string aa="d";
if (aa=="d")
{
Console.WriteLine(aa.Replace("d", "a"));
}
//string b = aa.Replace(".", "").Replace("officeword", "doc").Replace("gw", "other") == "" ? "other" : aa.Replace(".", "").Replace("officeword", "doc").Replace("gw", "other");
// Console.WriteLine(b);