# strlib

> string util function library

Latest version **1.0.3** (published 2016-01-29) · MIT license · 0 weekly downloads

## Install

```sh
npm install strlib
pnpm add strlib
yarn add strlib
bun add strlib
```

## 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.3 |
| Published | 2016-01-29 |
| First published | 2016-01-29 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | ssnau |
| Maintainers | ssnau |
| Keywords | string, lib, libarary |

## Links

- npm: https://www.npmjs.com/package/strlib
- Repository: https://github.com/ssnau/strlib
- Homepage: https://github.com/ssnau/strlib#readme
- Issues: https://github.com/ssnau/strlib/issues
- npm.io page: https://npm.io/package/strlib

## Alternatives

- [@cantoo/pdf-lib](https://npm.io/package/@cantoo/pdf-lib.md) — 297.9K weekly downloads
- [datatables.net-buttons](https://npm.io/package/datatables.net-buttons.md) — 200.1K weekly downloads
- [@ckeditor/ckeditor5-export-pdf](https://npm.io/package/@ckeditor/ckeditor5-export-pdf.md) — 167.0K weekly downloads
- [scanbot-web-sdk](https://npm.io/package/scanbot-web-sdk.md) — 15.0K weekly downloads
- [@syncfusion/ej2-angular-pdfviewer](https://npm.io/package/@syncfusion/ej2-angular-pdfviewer.md) — 8.8K weekly downloads

## Recent versions

- 1.0.3 (latest) — 2016-01-29
- 1.0.2 — 2016-01-29
- 1.0.1 — 2016-01-29
- 1.0.0 — 2016-01-29

## README

strlib
-------

common javascript string manipulate library.


# install

```
npm install strlib
```


# API


### merge(strA, strB, needle)

merge any string with tail and head in common. `needle` is optional.

```
merge('http://example.com/', '/foo/bar') => 'http://example.com/foo/bar'
merge('http://example.com/', 'foo/bar') => 'http://example.com/foo/bar'

merge('i like cat', 'cat are lonely') => 'i like cat are lonely'
merge('i like catcat', 'catcat are lonely') => 'i like catcat are lonely'

merge('http://example.com', 'com/boo') => 'http://example.com/boo'
// if needle is provided and their common part is not needle, needle will be inserted
merge('http://example.com', 'com/boo', '/') => 'http://example.com/com/boo'
```

###  escapeHTML(string)

convert html string to safe string.

###  escapeRegExp(string)

convert a string to be able to handle by `new Regexp`

###  replaceAll(string, from, to)

replace all the occurrence by string and you don't need to build regexp yourself.

###  getConcatationString(a, b)

similar to merge, but return you the common part of the two string about their tail and head.

###  ucfirst(str)

convert the first char to upper case.

License
----

MIT

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