Methods summary
public static
string
|
#
ascii( string $value )
Transliterate a UTF-8 value to ASCII.
Transliterate a UTF-8 value to ASCII.
Parameters
Returns
string
|
public static
string
|
#
camel( string $value )
Convert a value to camel case.
Convert a value to camel case.
Parameters
Returns
string
|
public static
boolean
|
#
contains( string $haystack, string|array $needle )
Determine if a given string contains a given sub-string.
Determine if a given string contains a given sub-string.
Parameters
- $haystack
string $haystack
- $needle
string|array $needle
Returns
boolean
|
public static
boolean
|
#
endsWith( string $haystack, string|array $needles )
Determine if a given string ends with a given needle.
Determine if a given string ends with a given needle.
Parameters
- $haystack
string $haystack
- $needles
string|array $needles
Returns
boolean
|
public static
string
|
#
finish( string $value, string $cap )
Cap a string with a single instance of a given value.
Cap a string with a single instance of a given value.
Parameters
- $value
string $value
- $cap
string $cap
Returns
string
|
public static
boolean
|
#
is( string $pattern, string $value )
Determine if a given string matches a given pattern.
Determine if a given string matches a given pattern.
Parameters
- $pattern
string $pattern
- $value
string $value
Returns
boolean
|
public static
integer
|
#
length( string $value )
Return the length of the given string.
Return the length of the given string.
Parameters
Returns
integer
|
public static
string
|
#
limit( string $value, integer $limit = 100, string $end = '...' )
Limit the number of characters in a string.
Limit the number of characters in a string.
Parameters
- $value
string $value
- $limit
integer $limit
- $end
string $end
Returns
string
|
public static
string
|
#
lower( string $value )
Convert the given string to lower-case.
Convert the given string to lower-case.
Parameters
Returns
string
|
public static
string
|
#
words( string $value, integer $words = 100, string $end = '...' )
Limit the number of words in a string.
Limit the number of words in a string.
Parameters
- $value
string $value
- $words
integer $words
- $end
string $end
Returns
string
|
public static
array
|
#
parseCallback( string $callback, string $default )
Parse a Class@method style callback into class and method.
Parse a Class@method style callback into class and method.
Parameters
- $callback
string $callback
- $default
string $default
Returns
array
|
public static
string
|
#
plural( string $value, integer $count = 2 )
Get the plural form of an English word.
Get the plural form of an English word.
Parameters
- $value
string $value
- $count
integer $count
Returns
string
|
public static
string
|
#
random( integer $length = 16 )
Generate a more truly "random" alpha-numeric string.
Generate a more truly "random" alpha-numeric string.
Parameters
Returns
string
|
public static
string
|
#
quickRandom( integer $length = 16 )
Generate a "random" alpha-numeric string.
Generate a "random" alpha-numeric string.
Should not be considered sufficient for cryptography, etc.
Parameters
Returns
string
|
public static
string
|
#
upper( string $value )
Convert the given string to upper-case.
Convert the given string to upper-case.
Parameters
Returns
string
|
public static
string
|
#
singular( string $value )
Get the singular form of an English word.
Get the singular form of an English word.
Parameters
Returns
string
|
public static
string
|
#
slug( string $title, string $separator = '-' )
Generate a URL friendly "slug" from a given string.
Generate a URL friendly "slug" from a given string.
Parameters
- $title
string $title
- $separator
string $separator
Returns
string
|
public static
string
|
#
snake( string $value, string $delimiter = '_' )
Convert a string to snake case.
Convert a string to snake case.
Parameters
- $value
string $value
- $delimiter
string $delimiter
Returns
string
|
public static
boolean
|
#
startsWith( string $haystack, string|array $needles )
Determine if a string starts with a given needle.
Determine if a string starts with a given needle.
Parameters
- $haystack
string $haystack
- $needles
string|array $needles
Returns
boolean
|
public static
string
|
#
studly( string $value )
Convert a value to studly caps case.
Convert a value to studly caps case.
Parameters
Returns
string
|
public static
|
#
macro( string $name, callable $macro )
Register a custom string macro.
Register a custom string macro.
Parameters
- $name
string $name
- $macro
callable $macro
|
public static
mixed
|
#
__callStatic( string $method, array $parameters )
Dynamically handle calls to the string class.
Dynamically handle calls to the string class.
Parameters
- $method
string $method
- $parameters
array $parameters
Returns
mixed
|