标签:bcd max console trim substr array rem str null
string s=abcdeabcdeabcde
string[] sArray1=s.Split(new char[3]{c,d,e}) ;
foreach(string i in sArray1)
Console.WriteLine(i.ToString());
//IDeanem = IDneme.Length > 20 ? IDneme.Substring(0, 20) + "..." : IDneme.ToString();
/// <summary>
/// 截取字符
/// </summary>
/// <param name="text"></param>
/// <param name="maxlength"></param>
/// <returns></returns>
public static string strlenght(string text, int maxlength)
{
text = text.ToLower().Trim();
if ((string.IsNullOrEmpty(text)))
{
return string.Empty;
}
if ((text.Length > maxlength))
{
text = text.Substring(0, maxlength) + "...";
}
return text;
}
标签:bcd max console trim substr array rem str null
原文地址:http://www.cnblogs.com/mhg215/p/6402385.html