(array) tokenize (delimiter, rawFirst)
Explode compound words to tokens.
Parameters:
name | type | default | caption |
---|---|---|---|
delimiter | string | '_' | Delimiter. |
rawFirst | boolean | false | Keep raw first word in tokens for camelCase. |
Returns:
- (array) — tokens.
Author:
- StewEucen
Since:
- Version 1.0.0
Examples:
"highClass".tokenize() //=> ['High', 'Class']
"highClass".tokenize('_', true) //=> ['high', 'Class']
"StudlyCaps".tokenize() //=> ['Studly', 'Caps']
"snake_case".tokenize() //=> ['snake', 'case']
"get_utc__day".tokenize() //=> ['get', 'utc_', 'day']