shouding / mix-string
When unicode characters and ascii characters mixed, according to your needs, calculate the length of the string
Installs: 14
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
pkg:composer/shouding/mix-string
Requires
- danielstjules/stringy: ~2.3
This package is not auto-updated.
Last update: 2025-10-06 18:17:09 UTC
README
Description
When unicode characters and ascii characters mixed, according to your needs, calculate the length of the string
Example
need composer
{ "require": { "shouding/mix-string": "1.0.0" } }
>>> require('vendor/autoload.php') => Composer\Autoload\ClassLoader {#162} >>> use Shouding\Mix\Str; => null >>> Str::length("this is a test 中国") => 6 >>> Str::length("this is a test 中国", Str::TYPE_CHAR) => 17 >>> Str::length("this is a test 中国", Str::TYPE_BYTES) => 21