/*
 * @Author: 吴文洁
 * @Date: 2020-08-20 09:20:43
 * @LastEditors: 吴文洁
 * @LastEditTime: 2020-08-21 09:02:36
 * @Description: 
 * @Copyright: 杭州杰竞科技有限公司 版权所有
 */
// 限制字数
const getEllipsText = (text: string, limitNum: number) => {
  const limitText: string = text.replace(/\n/g, ' ');
  
  if (limitText.length > limitNum) {
    return `${limitText.substr(0, limitNum)}...`;
  }
  return limitText;
}

export {
  getEllipsText
}