StringHelper
in package
FinalYes
String Utility.
Table of Contents
Methods
- ellipsis() : string
- Omit strings that are too long. Characters longer than the specified length will be replaced by "...".
- empty() : string
- Trims the string to determine if it is empty.
- trim() : string
- Trim front and rear spaces.
Methods
ellipsis()
Omit strings that are too long. Characters longer than the specified length will be replaced by "...".
public
static ellipsis(string $str[, int $length = 100 ]) : string
Parameters
- $str : string
-
String.
- $length : int = 100
-
(optional) Length of string. Default is 100.
Return values
string —String.
empty()
Trims the string to determine if it is empty.
public
static empty(string|null $str) : string
Parameters
- $str : string|null
-
String.
Return values
string —String.
trim()
Trim front and rear spaces.
public
static trim(string|null $str) : string
Parameters
- $str : string|null
-
String.
Return values
string —String.