获取字符串长度

/// <summary>

/// 计算字符串长度

/// </summary>

public static int GetByteLength(string text)

{

     return System.Text.Encoding.Default.GetBytes(text).Length;

}  

posted @ 2013-10-15 22:25  源起  阅读(114)  评论(0编辑  收藏  举报