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;
}
时间: 2024-10-13 12:48:25