Ubiquity 2.5.2
php rapid development framework
Loading...
Searching...
No Matches
UString Class Reference

String utilities. More...

Static Public Member Functions

static startswith ($hay, $needle)
 
static contains ($needle, $haystack)
 
static containsValues (array $values, string $haystack)
 
static endswith ($hay, $needle)
 
static getBooleanStr ($value)
 
static isNull ($s)
 
static isNotNull ($s)
 
static isBooleanTrue ($s)
 
static isBooleanFalse ($s)
 
static isBoolean ($value)
 
static isBooleanStr ($value)
 
static pluralize ($count, $zero, $one, $other)
 Pluralize an expression.
 
static firstReplace ($haystack, $needle, $replace)
 
static replaceFirstOccurrence ($pattern, $replacement, $subject)
 
static replaceArray ($haystack, $needleArray, $replace)
 
static doubleBackSlashes ($value)
 
static cleanAttribute ($attr, $replacement="-")
 
static mask ($secretString, $maskChar="*")
 
static isValid ($value)
 
static isJson ($value)
 
static toString ($value)
 Converts a value to a string.
 
static explode ($delimiters, $string)
 Explodes a string with an array of delimiters.
 
static isExpression (string $v)
 Returns true is value is a php expression.
 

Detailed Description

String utilities.

Ubiquity\utils\base$UString This class is part of Ubiquity

Author
jcheron myadd.nosp@m.ress.nosp@m.mail@.nosp@m.gmai.nosp@m.l.com
Version
1.0.6

Definition at line 15 of file UString.php.

Member Function Documentation

◆ cleanAttribute()

static cleanAttribute (   $attr,
  $replacement = "-" 
)
static

Definition at line 113 of file UString.php.

◆ contains()

static contains (   $needle,
  $haystack 
)
static

Definition at line 21 of file UString.php.

◆ containsValues()

static containsValues ( array  $values,
string  $haystack 
)
static

Definition at line 25 of file UString.php.

◆ doubleBackSlashes()

static doubleBackSlashes (   $value)
static

Definition at line 107 of file UString.php.

◆ endswith()

static endswith (   $hay,
  $needle 
)
static

Definition at line 34 of file UString.php.

◆ explode()

static explode (   $delimiters,
  $string 
)
static

Explodes a string with an array of delimiters.

Parameters
array$delimiters
string$string
Returns
array

Definition at line 152 of file UString.php.

◆ firstReplace()

static firstReplace (   $haystack,
  $needle,
  $replace 
)
static

Definition at line 85 of file UString.php.

◆ getBooleanStr()

static getBooleanStr (   $value)
static

Definition at line 38 of file UString.php.

◆ isBoolean()

static isBoolean (   $value)
static

Definition at line 58 of file UString.php.

◆ isBooleanFalse()

static isBooleanFalse (   $s)
static

Definition at line 54 of file UString.php.

◆ isBooleanStr()

static isBooleanStr (   $value)
static

Definition at line 62 of file UString.php.

◆ isBooleanTrue()

static isBooleanTrue (   $s)
static

Definition at line 50 of file UString.php.

◆ isExpression()

static isExpression ( string  $v)
static

Returns true is value is a php expression.

Parameters
string$v
Returns
bool

Definition at line 161 of file UString.php.

◆ isJson()

static isJson (   $value)
static

Definition at line 128 of file UString.php.

◆ isNotNull()

static isNotNull (   $s)
static

Definition at line 46 of file UString.php.

◆ isNull()

static isNull (   $s)
static

Definition at line 42 of file UString.php.

◆ isValid()

static isValid (   $value)
static

Definition at line 124 of file UString.php.

◆ mask()

static mask (   $secretString,
  $maskChar = "*" 
)
static

Definition at line 120 of file UString.php.

◆ pluralize()

static pluralize (   $count,
  $zero,
  $one,
  $other 
)
static

Pluralize an expression.

Parameters
int$countthe count of elements
string$zerovalue to return if count==0, can contains {count} mask
string$onevalue to return if count==1, can contains {count} mask
string$othervalue to return if count>1, can contains {count} mask
Returns
string the pluralized expression

Definition at line 75 of file UString.php.

◆ replaceArray()

static replaceArray (   $haystack,
  $needleArray,
  $replace 
)
static

Definition at line 99 of file UString.php.

◆ replaceFirstOccurrence()

static replaceFirstOccurrence (   $pattern,
  $replacement,
  $subject 
)
static

Definition at line 94 of file UString.php.

◆ startswith()

static startswith (   $hay,
  $needle 
)
static

Definition at line 17 of file UString.php.

◆ toString()

static toString (   $value)
static

Converts a value to a string.

Parameters
mixed$value
Returns
string

Definition at line 138 of file UString.php.


The documentation for this class was generated from the following file: