String 中的Trim

Trim 切除首尾指定字符

var newStr="";

char[] trimChars={'@','#','$',' '};

string strC="@Hello# $";

newStr=strC.Trim(trimChars);

Console.WriteLine(newStr);//"Hello"
原文地址:https://www.cnblogs.com/moonstars/p/14775832.html