Files
zhamao-logger/src/ZM/Logger/TextUtil.php
crazywhalecc 06b76e4c96 initial commit
2022-05-12 20:27:01 +08:00

15 lines
335 B
PHP

<?php
declare(strict_types=1);
namespace ZM\Logger;
class TextUtil
{
public static function separatorToCamel(string $string, string $separator = '_'): string
{
$string = $separator . str_replace($separator, ' ', strtolower($string));
return ltrim(str_replace(' ', '', ucwords($string)), $separator);
}
}