mirror of
https://github.com/zhamao-robot/zhamao-logger.git
synced 2026-07-02 14:25:40 +08:00
15 lines
335 B
PHP
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);
|
|
}
|
|
}
|