# @tson1/string-utils

> javascript string utilits

Latest version **1.0.5** (published 2020-10-15) · MIT license · 0 weekly downloads

## Install

```sh
npm install @tson1/string-utils
pnpm add @tson1/string-utils
yarn add @tson1/string-utils
bun add @tson1/string-utils
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.5 |
| Published | 2020-10-15 |
| First published | 2020-10-07 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 6.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | tson1 |
| Maintainers | tson1 |
| Keywords | javascript, string, utilis |

## Links

- npm: https://www.npmjs.com/package/@tson1/string-utils
- Repository: https://github.com/Tson1/string-utility
- Homepage: https://github.com/Tson1/string-utility#readme
- Issues: https://github.com/Tson1/string-utility/issues
- npm.io page: https://npm.io/package/@tson1/string-utils

## Dependencies (2)

- [ramda](https://npm.io/package/ramda.md) ^0.27.1
- [@types/ramda](https://npm.io/package/@types/ramda.md) ^0.27.23

## Alternatives

- [@mce/gif](https://npm.io/package/@mce/gif.md) — 2.6K weekly downloads
- [cleanse](https://npm.io/package/cleanse.md) — 173 weekly downloads
- [str](https://npm.io/package/str.md) — 127 weekly downloads
- [naming](https://npm.io/package/naming.md) — 95 weekly downloads
- [tap-telco-api](https://npm.io/package/tap-telco-api.md) — 19 weekly downloads

## Recent versions

- 1.0.5 (latest) — 2020-10-15
- 1.0.4 — 2020-10-10
- 1.0.3 — 2020-10-10
- 1.0.2 — 2020-10-10
- 1.0.1 — 2020-10-09
- 1.0.0 — 2020-10-07

## README

# string-utility

![travis-ci](https://travis-ci.org/Tson1/string-utility.svg?branch=main)
![language](https://img.shields.io/badge/language-typescript-orange.svg)
![license-MIT](https://img.shields.io/badge/license-MIT-green.svg)
![npm-version](https://img.shields.io/badge/npm-v1.0.5-green.svg)
![npm](https://nodei.co/npm/@tson1/string-utils.png?mini=true)

### 字符串儿的一些基本操作。

### 使用方法。

```
import * as strUtli from '@tson1/string-utils';
```

1. hasChinese //含有中文字符时返回真。

```
strUtli.hasChinese('你好world.'); // true
strUtli.hasChinese('world.'); // false
```

2. mixNotChinese //含有非中文字符时。True

```
strUtli.mixNotChinese('你好world.'); // true
strUtli.mixNotChinese('world.'); // true
strUtli.mixNotChinese('你好'); // false
```

3. splitByChinese // 按中文与非中文分割字符串

```
strUtli.splitByChinese('你好world.'); // [ '你好', 'world.' ]

strUtli.splitByChinese('我是小猪PEIQI，你好！'); // [ '我是小猪', 'PEIQI，', '你好', '！' ]
strUtli.splitByChinese('白日依山尽'); // [ '白日依山尽' ]
strUtli.splitByChinese(undefined); // undifined
strUtli.splitByChinese(null); // null
strUtli.splitByChinese(''); // ''
```

4. isUrlGlobal // 全局参照 [//] or [http] or [https]

```
strUtli.isUrlGlobal('http://xfutian.com'); // true
strUtli.isUrlGlobal('//xfutian.com'); // true
strUtli.isUrlGlobal('../xfutian.com'); // false
```

<!-- https://nodei.co/npm/@tson1/string-utils.png?compact=true -->

---

### 发布履历

-   1.0.5

    -   isUrlGlobal // 全局参照

-   1.0.4 之前，初版

    -   splitByChinese // 按中文与非中文分割字符串

---
_Source: https://npm.io/package/@tson1/string-utils · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
