我试图在字符串中找到每一个 ASCII 字符的出现, 代之以新的线条。
public string parseText(string inTxt)
{
//String builder based on the string passed into the method
StringBuilder n = new StringBuilder(inTxt);
//Convert the ASCII character we re looking for to a string
string replaceMe = char.ConvertFromUtf32(187);
//Replace all occurences of string with a new line
n.Replace(replaceMe, Environment.NewLine);
//Convert our StringBuilder to a string and output it
return n.ToString();
}
这不会添加到新的线条, 字符串都保留在一条线上。 我不知道这里有什么问题。 我也试过了, 但结果相同 :
n.Replace(replaceMe, "
");
有什么建议吗?