///
/// 获得字符串的长度,一个汉字的长度为1
///
public static int GetStringLength(string s)
{
if (!string.IsNullOrEmpty(s))
return Encoding.Default.GetBytes(s).Length;
return 0;
}
#region 分割字符串
///
/// 分割字符串
///
/// 源字符串
/// 分隔字符串
///
public static string[] SplitString(string sourceStr, string splitStr)
{
if (string.IsNullOrEmpty(sourceStr) || string.IsNullOrEmpty(splitStr))
return new string[0] { };
if (sourceStr.IndexOf(splitStr) == -1)