使用 变量.Replace(@“\0”,"")
string str="abcde\0\0\0\0\0\0";
str=str.Replace(@"\0","");
str的结果是abcde。
使用 变量.Replace(@“\0”,"")
string str="abcde\0\0\0\0\0\0";
str=str.Replace(@"\0","");
str的结果是abcde。
转载于:https://www.cnblogs.com/Sukie-s-home/p/5702856.html