Download the PHP package pataar/smartstring without Composer
On this page you can find all versions of the php package pataar/smartstring. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download pataar/smartstring
More information about pataar/smartstring
Files in pataar/smartstring
Package smartstring
Short Description A class to manipulate a string with a better syntax.
License MIT
Informations about the package smartstring
SmartString
Installation
Using Composer:
Usage
Creating a SmartString object
Either do
Or
Using a SmartString object
After creating your SmartString, you can use several chainable methods to manipulate the string.
Some examples:
Functions
toUpper()
Creates an uppercase version of the string.
toLower()
Creates an lowercase version of the string.
Trim()
Trims the string. So removes any trailing whitespaces and spaces.
printme()
Prints the string.
indexOf($input)
Returns the index of a certain $input string.
substring($start, $length)
Creates a substring of an existing string.
toMd5()
Creates an MD5 hash of the string.
toMd5WithSalt($salt)
Creates an salted MD5 hash of the string. Using both a prefix and suffix containing the given $salt
.
encodeB64() || decodeB64()
Encodes or decodes a B64 string.
charAt($index)
Tells you on which index a certain character is placed.
equals($string)
Returns when the $string matches the $smartString.
prefix($prefix)
Adds a $prefix to the string.
suffix($suffix)
Adds a $suffix to the string.
concat($string)
Concats a string.
replace($search, $replacement)
Replace a string with an other string.
replacePattern($pattern, $replacement)
Replaces a pattern.
remove($string)
Remove a string
length()
Returns the length of the string.
normalize()
Normalizes the string. Making it URL/slug compatible.