mirror of
https://github.com/zhamao-robot/zhamao-logger.git
synced 2026-07-22 16:15:35 +08:00
initial commit
This commit is contained in:
14
src/ZM/Logger/TextUtil.php
Normal file
14
src/ZM/Logger/TextUtil.php
Normal file
@@ -0,0 +1,14 @@
|
||||
<?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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user