StringHelper
class StringHelper (View source)
The StringHelper class.
Constants
INCREMENT_STYLE_DASH |
|
INCREMENT_STYLE_DEFAULT |
|
Methods
isEmptyString
isZero
Quote a string.
Back quote a string.
Increments a trailing number in a string.
at
remove spaces
endsWith
startsWith
Explode a string and force elements number.
Details
at line line 45
static boolean
isEmpty(string $string)
isEmptyString
at line line 64
static boolean
isZero(string $string)
isZero
at line line 77
static string
quote(string $string, array $quote = array('"', '"'))
Quote a string.
at line line 96
static string
backquote(string $string)
Back quote a string.
at line line 117
static string
increment(string $string, string $style = self::INCREMENT_STYLE_DEFAULT, integer $n)
Increments a trailing number in a string.
Used to easily create distinct labels when copying objects. The method has the following styles:
default: "Label" becomes "Label (2)" dash: "Label" becomes "Label-2"
at line line 166
static string
at(string $string, int $num)
at
at line line 188
static string
collapseWhitespace(string $string)
remove spaces
See: http://stackoverflow.com/questions/3760816/remove-new-lines-from-string And: http://stackoverflow.com/questions/9558110/php-remove-line-break-or-cr-lf-with-no-success
at line line 204
static boolean
endsWith(string $string, string $target, boolean $caseSensitive = true)
endsWith
at line line 234
static boolean
startsWith(string $string, string $target, boolean $caseSensitive = true)
startsWith
at line line 255
static array
explode(string $separator, string $data, int $number = null, string $callback = 'array_push')
Explode a string and force elements number.