var str= ",2,3,4,6,7,"; var str2 = str.Trim(new char[] { ‘,‘ }); //去除字符串str两端的‘,‘字符。 //则str2 为:"2,3,4,6,7"
C# Trim方法去除字符串两端的指定字符,布布扣,bubuko.com
时间: 2024-10-14 13:47:16
var str= ",2,3,4,6,7,"; var str2 = str.Trim(new char[] { ‘,‘ }); //去除字符串str两端的‘,‘字符。 //则str2 为:"2,3,4,6,7"
C# Trim方法去除字符串两端的指定字符,布布扣,bubuko.com