Travis build: 475

This commit is contained in:
Travis CI
2017-12-29 11:01:28 +00:00
parent 5c6842aae4
commit f685a945be
2 changed files with 32 additions and 0 deletions

View File

@ -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.