ASP.NET字数截取

    public static string SubStr(string sString, int nLength)
    {
        if (sString.Length <= nLength)
        {
            return sString;
        }
        string newStr = sString.Substring(0,nLength);
        newStr = newStr + "...";
        return newStr;
    }

 

posted @ 2012-11-22 10:13  Liu66~  阅读(195)  评论(0编辑  收藏  举报