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('|')会将所有的|都会清除!

  

相关文章:

  • 2021-06-28
  • 2021-12-21
  • 2022-12-23
  • 2022-12-23
  • 2021-09-03
  • 2022-12-23
  • 2021-11-07
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-13
相关资源
相似解决方案