StringHelper

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 hans@xmpl.org

package

phing.system.util

Methods

booleanValue

booleanValue( $s) : boolean
static

Arguments

$s

Response

boolean

tests if a string ends with a given string

endsWith( $check,  $string) 
static

Arguments

$check

$string

hashCode

hashCode( $string) : integer
static

Arguments

$string

Response

integer

tests if a string is a representative of a boolean

isBoolean( $s) 
static

Arguments

$s

Does the value correspond to a slot variable?

isSlotVar(string $value) 
static

Arguments

$value

string

Creates a key based on any number of passed params.

key() : string
static

Response

string

Replaces identifier tokens with corresponding text values in passed string.

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

Arguments

$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.

Response

string

prefix

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

Arguments

$columns

array

String[]

$prefix

string

Response

array

String[]

Get the qualifier part of a qualified name.

qualifier( $qualifiedName,  $seperator = '.') : string
static

E.g. eg.Cat -> eg

Arguments

$qualifiedName

$seperator

Response

string

root

root( $qualifiedName,  $separator = '.') : string
static

Arguments

$qualifiedName

$separator

Response

string

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

slotVar(string $var) : string
static

Arguments

$var

string

The var from build file.

Response

string

Extracted name part.

tests if a string starts with a given string

startsWith( $check,  $string) 
static

Arguments

$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 = -1) 
static

Arguments

$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

Arguments

$str

Response

array

Remove qualification to name.

unqualify(string $qualifiedName, string $separator = '.') 
static

E.g. eg.Cat -> Cat

Arguments

$qualifiedName

string

$separator

string

Character used to separate.

Properties

TRUE_VALUES

TRUE_VALUES : 
static

Type(s)

FALSE_VALUES

FALSE_VALUES : 
static

Type(s)