shared
utils
string
object
is
extension
js
tracking
string
dom
when
selection
position
iframe
event
scroll
console
node
string
project
fs
console
splitEvery
Type:Function
Status:stable
Since:1.0.0
Platform:jsnode
@blackbyte.sugar.shared.string
Split a string every n chars either by taking care of not spliting the words, or by simply spliting without any attention to that…
Params
- text*-String
The text to split
- every*-Number
How many characters to split the text
- settings{}Partial<TSplitEverySettings
Some settings to configure your split process
Return
- -Array
An array of the splited text parts
Example
import { splitEvery } from '@blackbyte/sugar/string';
splitEvery('Hello World', 2, {
splitWords: true
}); // => ['He','ll','o ','Wo','rl','d']Settings
- splitWordstrueBoolean
If you want to split the words or not…
Todo
- testsnormal
Author
- Olivier Bosselolivier.bossel@gmail.comhttps://blackbyte.space