Trait String_Helper
Trait VSP_String_Trait
Direct Known Users
VSP\Helper
Namespace: VSP\Core\Traits
Author: Varun Sridharan varunsridharan23@gmail.com
Located at includes/core/traits/class-string-helper.php
Author: Varun Sridharan varunsridharan23@gmail.com
Located at includes/core/traits/class-string-helper.php
public static
boolean
|
#
str_starts_with( string $haystack, string $needle )
Returns true if the haystack string starts with needle |
public static
string
|
#
str_to_ascii( string $string )
Returns a string with all non-ASCII characters removed. This is useful for any string functions that expect only ASCII chars and can't safely handle UTF-8. Note this only allows ASCII chars in the range 33-126 (newlines/carriage returns are stripped) |
public static
boolean
|
#
str_ends_with( string $haystack, string $needle )
Return true if the haystack string ends with needle Note: case-sensitive |
public static
boolean
|
#
str_exists( string $haystack, string $needle )
Returns true if the needle exists in haystack Note: case-sensitive |
public static
string
|
#
str_truncate( string $string, integer $length, string $omission = '...' )
Truncates a given $string after a given $length if string is longer than $length. The last characters will be replaced with the $omission string for a total length not exceeding $length |
public static
string
|
protected static
string
|
$mb_enc
MB_ENCODING |
#
'UTF-8'
|