Skip to content

When unicode characters and ascii characters mixed, according to your needs, calculate the length of the string

Notifications You must be signed in to change notification settings

oxUnd/mix-string

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Shouding\Mix\Str

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

About

When unicode characters and ascii characters mixed, according to your needs, calculate the length of the string

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages