All Data Structures Functions Variables Pages
Static Public Member Functions | Data Fields
StringUtil Class Reference

Static Public Member Functions

static getChoppedStringContent ($string, $length, $ellipsis= '...')
 
static resolveOrdinalIntegerAsStringContent ($integer)
 
static renderFluidContent ($content)
 
static renderFluidTitleContent ($title, $postTruncatedTitleContent=null)
 
static resolveCustomizedLabel ()
 
static uncamelize ($string)
 
static camelize ($string, $capitaliseFirstCharacter=false, $delimiter= '_')
 
static prependNewLine (&$content, $isHtmlContent)
 
static generateRandomString ($length=10, $characterSet=null)
 
static startsWith ($haystack, $needle)
 
static endsWith ($haystack, $needle)
 
static addSchemeIfMissing ($url, $scheme= 'http')
 
static resolveHashForQueryStringArray ($queryStringArray)
 
static isValidHash ($hash)
 
static convertToBytes ($value)
 
static makeWordsUpperCase ($string)
 

Data Fields

const VALID_HASH_PATTERN = '~^[A-Z0-9\+=/ ]+~i'
 

Detailed Description

Helper functionality for working with Strings

Definition at line 40 of file StringUtil.php.

Member Function Documentation

static getChoppedStringContent (   $string,
  $length,
  $ellipsis = '...' 
)
static

Given a string and a length, return the chopped string if it is larger than the length.

Parameters
$string
$length
string$ellipsis
Returns
string

Definition at line 51 of file StringUtil.php.

static resolveOrdinalIntegerAsStringContent (   $integer)
static

Given an integer, resolve the integer with an ordinal suffix and return the content as as string.

Parameters
integer$number

Definition at line 69 of file StringUtil.php.

static resolveCustomizedLabel ( )
static

used for customizing label in UI

Definition at line 111 of file StringUtil.php.

static prependNewLine ( $content,
  $isHtmlContent 
)
static

used to add a new line to content.

Parameters
$content
$isHtmlContent

Definition at line 138 of file StringUtil.php.

static generateRandomString (   $length = 10,
  $characterSet = null 
)
static

Generate a random string

Parameters
int$length
null$characterSet
Returns
string

Definition at line 156 of file StringUtil.php.

static startsWith (   $haystack,
  $needle 
)
static
Parameters
$haystack
$needle
Returns
bool

Definition at line 177 of file StringUtil.php.

static endsWith (   $haystack,
  $needle 
)
static
Parameters
$haystack
$needle
Returns
bool

Definition at line 187 of file StringUtil.php.

static addSchemeIfMissing (   $url,
  $scheme = 'http' 
)
static

Add a default scheme to url

Parameters
$url
string$scheme
Returns
string

Definition at line 198 of file StringUtil.php.

static convertToBytes (   $value)
static

Convert kilobytes, megabytes, and gigabytes into bytes input value is in format $value{size} where size is in {'K','M','G'}

Parameters
$value
Returns
int

Definition at line 240 of file StringUtil.php.

static makeWordsUpperCase (   $string)
static

Similar to calling ucwords() except this handles multiple-byte encoding properly

Parameters
$string
Returns
string

Definition at line 261 of file StringUtil.php.


The documentation for this class was generated from the following file:
Generated on Wed Apr 8 2020 07:11:20