Travis build: 475
This commit is contained in:
24
README.md
24
README.md
@ -223,6 +223,7 @@
|
||||
* [`repeatString`](#repeatstring)
|
||||
* [`reverseString`](#reversestring)
|
||||
* [`sortCharactersInString`](#sortcharactersinstring)
|
||||
* [`splitLines`](#splitlines)
|
||||
* [`toCamelCase`](#tocamelcase)
|
||||
* [`toKebabCase`](#tokebabcase)
|
||||
* [`toSnakeCase`](#tosnakecase)
|
||||
@ -3577,6 +3578,29 @@ sortCharactersInString('cabbage'); // 'aabbceg'
|
||||
[⬆ Back to top](#table-of-contents)
|
||||
|
||||
|
||||
### splitLines
|
||||
|
||||
Splits a multiline string into an array of lines.
|
||||
|
||||
Use `String.split()` and a regular expression to match line breaks and create an array.
|
||||
|
||||
```js
|
||||
const splitLines = str => str.split(/\r?\n/);
|
||||
```
|
||||
|
||||
<details>
|
||||
<summary>Examples</summary>
|
||||
|
||||
```js
|
||||
splitLines('This\nis a\nmultiline\nstring.\n'); // ['This', 'is a', 'multiline', 'string' , '']
|
||||
```
|
||||
|
||||
</details>
|
||||
|
||||
|
||||
[⬆ Back to top](#table-of-contents)
|
||||
|
||||
|
||||
### toCamelCase
|
||||
|
||||
Converts a string to camelcase.
|
||||
|
||||
Reference in New Issue
Block a user