elminson / stringprocessor
StringProcessor
v1.0
2018-10-11 00:18 UTC
Requires
- phpunit/phpunit: ^7.4@dev
Requires (Dev)
- phpunit/phpunit: ^7.4@dev
This package is auto-updated.
Last update: 2024-09-11 15:24:04 UTC
README
#StringProcessor
完成方法/函数,使其将破折号/下划线分隔的单词转换为驼峰命名法。如果原始单词是首字母大写,则输出中的第一个单词也应首字母大写。
示例
toCamelCase("the-stealth-warrior"); // returns "theStealthWarrior" toCamelCase("The_Stealth_Warrior"); // returns "TheStealthWarrior"
使用
$stringprocessor = new StringProcessor(); $result=$stringprocessor->toCamelCase("hello_world")); //$result ==> helloWorld