Search Docs
words
Splits the str into an array of words, supporting various case styles and delimiters.
str
import { words } from 'funtool/string' words('helloWorld'); // ✅ ['hello', 'World'] words('HelloWorld'); // ✅ ['Hello', 'World'] words('hello_world'); // ✅ ['hello', 'world'] words('APIversion'); // ✅ ['API', 'version'] words('userID2Token'); // ✅ ['user', 'ID', '2', 'Token'] words('HTMLBody'); // ✅ ['HTML', 'Body'] words('APIResponse'); // ✅ ['API', 'Response']
function words(str: string): string[]
string
string[]