(array) tokenize (delimiter = '_', raw_first = false)
camelCase や StudlyCaps 、 snake_case などの複合語を、トークンに分割します。
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']