String helper utility class.

This class includes some Java-like functions for parsing strings, as well as some functions for getting qualifiers / unqualifying phing-style classpaths. (e.g. "phing.util.StringHelper").

author Hans Lellelid
package phing.system.util

 Methods

booleanValue()

booleanValue($s) : boolean
Static

Parameters

$s

Returns

boolean

tests if a string ends with a given string

endsWith($check, $string) 
Static

Parameters

$check

$string

hashCode()

hashCode($string) : int
Static

Parameters

$string

Returns

int

tests if a string is a representative of a boolean

isBoolean($s) 
Static

Parameters

$s

Does the value correspond to a slot variable?

isSlotVar(string $value) 
Static

Parameters

$value

string

Creates a key based on any number of passed params.

key() : string
Static

Returns

string

Replaces identifier tokens with corresponding text values in passed string.

multiply(array $strings, array $tokens, array $replacements) : string
Static

Parameters

$strings

array

Array of strings to multiply. (If string is passed, will convert to array)

$tokens

array

The tokens to search for.

$replacements

array

The values with which to replace found tokens.

Returns

string

prefix()

prefix(array $columns, string $prefix) : array
Static

Parameters

$columns

array

String[]

$prefix

string

Returns

arrayString[]

Get the qualifier part of a qualified name.

qualifier($qualifiedName, $seperator) : string
Static

E.g. eg.Cat -> eg

Parameters

$qualifiedName

$seperator

Returns

string

root()

root($qualifiedName, $separator) : string
Static

Parameters

$qualifiedName

$separator

Returns

string

Extracts the variable name for a slot var in the format %{task.current_file}

slotVar(string $var) : string
Static

Parameters

$var

string

The var from build file.

Returns

stringExtracted name part.

tests if a string starts with a given string

startsWith($check, $string) 
Static

Parameters

$check

$string

a natural way of getting a subtring, php's circular string buffer and strange return values suck if you want to program strict as of C or friends

substring($string, $startpos, $endpos) 
Static

Parameters

$string

$startpos

$endpos

Converts a string to an indexed array of chars There's really no reason for this to be used in PHP, since strings are all accessible using the $string{0} notation.

toCharArray($str) : array
Static
deprecated

Parameters

$str

Returns

array

Remove qualification to name.

unqualify(string $qualifiedName, string $separator) 
Static

E.g. eg.Cat -> Cat

Parameters

$qualifiedName

string

$separator

string

Character used to separate.

 Properties

 

$FALSE_VALUES 
 

$TRUE_VALUES