\Imi\UtilText

字符串工具类

Summary

Methods
Properties
Constants
startwith()
endwith()
insert()
isEmpty()
toCamelName()
toPascalName()
toUnderScoreCase()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
No private properties found
N/A

Methods

startwith()

startwith(string  $string, string  $compare, boolean  $caseSensitive = true) : string

字符串是否以另一个字符串开头

Parameters

string $string
string $compare
boolean $caseSensitive

Returns

string

endwith()

endwith(string  $string, string  $compare, boolean  $caseSensitive = true) : string

字符串是否以另一个字符串结尾

Parameters

string $string
string $compare
boolean $caseSensitive

Returns

string

insert()

insert(string  $string, integer  $position, string  $insertString) : string

插入字符串

Parameters

string $string

原字符串

integer $position

位置

string $insertString

被插入的字符串

Returns

string

isEmpty()

isEmpty(string  $string) : boolean

字符串是否为空字符串或者为null

Parameters

string $string

Returns

boolean

toCamelName()

toCamelName(string  $name) : string

转为驼峰命名,会把下划线后字母转为大写

Parameters

string $name

Returns

string

toPascalName()

toPascalName(string  $name) : string

转为每个单词大写的命名,会把下划线后字母转为大写

Parameters

string $name

Returns

string

toUnderScoreCase()

toUnderScoreCase(string  $name, boolean  $toLower = true) : string

转为下划线命名

Parameters

string $name
boolean $toLower

Returns

string