Str
class Str (View source)
Methods
camel
Snake case
lower case
Get str plural
slice
Len
Contains
Get the string position
replace
capitalize
Wordily
split
Returns the number of characters in a string.
Lists the string of characters in a specified number
Randomize
Get random uuid
Alias of slugify
slugify slug creator using a simple chain.
Alias of un-slugify
un-slugify, Lets you undo a slug
Check if the email is a valid email.
Check if the string is a domain
Check if the string is in alphanumeric
Check if the string is in numeric
Check if the string is in alpha
Check if the string is in slug format
Check if the string is in uppercase
upper case
Check if the string is lowercase
Returns a determined number of words in a string.
Returns a string of words whose words are mixed.
Enables to force the encoding in utf-8
Enables to force the encoding in utf-8
__call
Details
static string
camel(string $str)
camel
static string
snake(string $str, string $delimiter = '_')
Snake case
static string
lower(string $str)
lower case
static string
plural(string $str)
Get str plural
static string
slice(string $str, int $start, int|null $length = null)
slice
static int
len(string $str)
Len
static bool
contains(string $search, string $str)
Contains
static int
pos(string $search, string $string, int $offset = 0)
Get the string position
static string
replace(string $pattern, string $replaceBy, string $str)
replace
static string
capitalize(string $str)
capitalize
static array
wordily(string $str, string $sep = ' ')
Wordily
static array
split(string $pattern, string $str, int|null $limit = null)
split
static int
count(string $pattern, string $str)
Returns the number of characters in a string.
static string
repeat(string $str, int $number)
Lists the string of characters in a specified number
static string
random(int $size = 16)
Randomize
static string
uuid()
Get random uuid
static string
slug(string $str, string $delimiter = '-')
Alias of slugify
static string
slugify(string $str, string $delimiter = '-')
slugify slug creator using a simple chain.
eg: 'I am a string of character' => 'i-am-a-chain-of-character'
static string
unSlug(string $str)
Alias of un-slugify
static string
unSlugify(string $str)
un-slugify, Lets you undo a slug
static bool
isMail(string $email)
Check if the email is a valid email.
eg: example@email.com => true
static bool
isDomain(string $domain)
Check if the string is a domain
eg: http://example.com => true eg: http:/example.com => false
static bool
isAlphaNum(string $str)
Check if the string is in alphanumeric
static bool
isNumeric(string $str)
Check if the string is in numeric
static bool
isAlpha(string $str)
Check if the string is in alpha
static bool
isSlug(string $str)
Check if the string is in slug format
static bool
isUpper(string $str)
Check if the string is in uppercase
static string
upper(string $str)
upper case
static bool
isLower(string $str)
Check if the string is lowercase
static string
words(string $words, int $len)
Returns a determined number of words in a string.
static string
shuffleWords(string $words)
Returns a string of words whose words are mixed.
static void
forceInUTF8()
Enables to force the encoding in utf-8
static string
fixUTF8(string $garbled_utf8_string)
Enables to force the encoding in utf-8
mixed
__call(string $method, array $arguments = [])
__call