Download the PHP package mucts/string without Composer
On this page you can find all versions of the php package mucts/string. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package string
Str 字符串
Str
类提供一个便捷的操作字符串的封装。
使用
Str::camel
将给定字符串「蛇式」转化为
camelCase
「驼峰式」
Str::endsWith
函数判断指定的字符串是否以给定的值结尾
Str::kebab
将给定的「驼峰式」字符串转化为
kebab-case
「短横式」字符串
Str::snake
Str::snake
函数将给定的字符串转换为snake_case
「蛇式」
Str::startsWith
Str::startsWith
函数判断给定的字符串的开头是否是指定值
Str::after
Str::after
函数返回在字符串中指定值之后的所有内容
Str::before
Str::before
函数返回在字符串中指定值之前的所有内容
Str::contains
Str::contains
函数判断给定的字符串是否包含给定的值(区分大小写)
Str::finish
Str::finish
函数将给定的字符串以给定的值结尾返回(如果它尚未以给定值结尾)
Str::is
Str::is
函数判断给定的字符串是否匹配给定的模式。星号 * 可以用来表示通配符
Str::limit
Str::limit
函数按给定的长度截断给定的字符串你也可以传递第三个参数来改变将被追加到最后的字符串:
Str::orderedUuid
Str::orderedUuid
方法高效生成一个可存储在索引数据库列中的「第一时间」UUID
Str::plural
Str::plural
函数将字符串转换为复数形式。该函数目前仅支持英文你可以提供一个整数作为函数的第二个参数来检索字符串的单数或复数形式
Str::random
Str::random
函数生成一个指定长度的随机字符串。这个函数用PHP
的random_bytes
函数
Str::replaceArray
Str::replaceArray
函数使用数组顺序替换字符串中的给定值
Str::replaceFirst
Str::replaceFirst
函数替换字符串中给定值的第一个匹配项
Str::replaceLast
Str::replaceLast
函数替换字符串中最后一次出现的给定值:
Str::singular
Str::singular
函数将字符串转换为单数形式。该函数目前仅支持英文
Str::slug
Str::slug
函数将给定的字符串生成一个URL
友好的 「slug
」
Str::start
Str::start
函数将给定值添加到给定字符串的开始位置(如果字符串尚未以给定值开始)
Str::studly
Str::studly
函数将给定的字符串转换为 「变种驼峰命名」
Str::title
Str::title
函数将给定的字符串转换为「首字母大写」
Str::uuid
Str::uuid
方法生成一个UUID
(版本 4)
All versions of string with dependencies
ext-mbstring Version *
voku/portable-ascii Version ^1.5
mucts/macroable Version ^1.0
mucts/contracts Version ^1.0
mucts/collections Version ^1.0
doctrine/inflector Version ^2.0
ramsey/uuid Version ^4.1