using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace LZBS.Common
{
    public class CutString
    {
        /// <summary>
        /// 处理字符串截取功能
        /// </summary>
        /// <param name="str">要截取的字符串</param>
        /// <param name="n">从开始位置截取的字符个数</param>
        /// <returns>返回要截取的字符串</returns>
        public static string SubStr(string str, int n)
        {
            if (str.Length > n)
            {
                return str.Substring(0, n) + "...";
            }
            else
            {
                return str;
            }
        }
    }
}
