codestar-string-util
v1.2.1
Published
```typescript import stringUtil from "codestar-string-util"; ```
Downloads
2
Readme
字符串常用方法
import stringUtil from "codestar-string-util";字符串转数组
stringUtil.textToArray(text: string, separator = "\n", trimBlank = true): string[]
example:
expect(stringUtil.textToArray(`
1
2
`)).toStrictEqual(['1', '2'])驼峰转下划线
expect(stringUtil.camelToUnderline('userName')).toBe('user_name')
expect(stringUtil.camelToUnderline('UserName')).toBe('user_name')下划线转驼峰
expect(stringUtil.underlineToCamel('user_name')).toBe('userName')去掉字符串中的utf8-bom
stringUtil.stripBom(string: string): string