标签:
string str = "|||";
Console.WriteLine(str.Substring(0, str.Length - 1));
Console.WriteLine(str.Remove(str.LastIndexOf("|"), 1));
Console.WriteLine(str.Remove(str.Length - 1));
注:用str.TrimEnd(‘|‘)会将所有的|都会清除!
标签:
原文地址:http://www.cnblogs.com/XuPengLB/p/5948216.html