javascript实用工具函数utils(持续更新..)

去除字符串所有空格

export function clearStrSpace (str) {
    
    
  return str.replaceAll(' ', '')
}

敏感词过敏

export function Allergy (str, start, end, template) {
    
    
  const arr = Array.from(str)
  arr.splice(start, end, template)
  return arr.join('')
}

猜你喜欢

转载自blog.csdn.net/qq_40230735/article/details/125888877