Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在尝试处理一个字符串,使其不包含回车,但是我遇到了一些麻烦。我目前正在使用:
视觉工作室 2010:
strText = strText.Replace(vbCr, "")
回车没有被删除,谢谢。
你有没有尝试过
strText = strText.Replace("\n\r", "");
或者
strText = strText.Replace("\n", "");
strText = strText.Replace("\r", "");
strText = strText.TrimEnd('\r', '\n');