diff --git a/README.md b/README.md index f773225..0f7add0 100644 --- a/README.md +++ b/README.md @@ -33,7 +33,7 @@ StringTools::camelize($str, $from) : string #### ::startsWith ```php -StringTools::startsWith($str, $start, $encoding) : bool +StringTools::startsWith($str, $start) : bool ``` * `$str` string input diff --git a/StringTools.php b/StringTools.php index 679f6ca..c52d7c8 100644 --- a/StringTools.php +++ b/StringTools.php @@ -21,14 +21,13 @@ public static function camelize($str, $from = '_') /** * @param string $str * @param string $start - * @param string $encoding * @return bool */ - public static function startsWith($str, $start, $encoding = 'UTF-8') + public static function startsWith($str, $start) { - $length = mb_strlen($start, $encoding); + $length = strlen($start); - return mb_substr($str, 0, $length, $encoding) === $start; + return substr($str, 0, $length) === $start; } /**