UNPKG

guoall

Version:

17 lines (15 loc) 825 B
var tool=require("./tool.js"); var html=tool.trim(); console.log(html); //1 去除空格 trim (str, type 1-所有空格 2-前后空格 3-前空格 4-后空格) //2 改变大小写 changeCase(str, type 1: 首字母大写 2:首字母小写 3:大小写转换 4:全部大写 5:全部小写) //3 字符串循环 repeatStr(str->字符串, count->次数) //4 字符串替换 replaceAll(str, AFindText, ARepText) //5 替换 replaceStr(str, regArr, type, ARepText) //6 检测字符串 checkType (str, type) //7 检测密码强度 checkPwd (str) //8 随机码 randomWord (count) //9 查找字符串 countStr (str, strSplit) //10 格式化处理字符串 formatText (str, size, delimiter) //11 找出最长单词 longestWord (str, splitType) //12 句中单词首字母大写 titleCaseUp (str, splitType)