# 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(boolean|string $s) : boolean

static

### Arguments

#### $s

`boolean|string`

### Response

`boolean`

## tests if a string ends with a given string

    endsWith( $check,  $string) : boolean

static

### Arguments

#### $check

``

#### $string

``

### Response

`boolean`

## hashCode

    hashCode( $string) : integer

static

### Arguments

#### $string

``

### Response

`integer`

## tests if a string is a representative of a boolean

    isBoolean(boolean|string $s) : boolean

static

### Arguments

#### $s

`boolean|string`

### Response

`boolean`

## Does the value correspond to a slot variable?

    isSlotVar(string $value) : boolean|integer

static

### Arguments

#### $value

`string`

### Response

`boolean|integer`

## 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, string $seperator = '.') : string

static

E.g. eg.Cat -> eg

### Arguments

#### $qualifiedName

``

#### $seperator

`string`

### Response

`string`

## root

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

static

### Arguments

#### $qualifiedName

``

#### $separator

`string`

### 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) : boolean

static

### Arguments

#### $check

``

#### $string

``

### Response

`boolean`

## 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 $string, integer $startpos, integer $endpos = -1) : string

static

### Arguments

#### $string

`string`

#### $startpos

`integer`

#### $endpos

`integer`

### Response

`string`

## 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(string $str) : array

static

deprecated |

### Arguments

#### $str

`string`

### Response

`array`

## Remove qualification to name.

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

static

E.g. eg.Cat -> Cat

### Arguments

#### $qualifiedName

`string`

#### $separator

`string`

Character used to separate.

### Response

`string`

### Properties

## TRUE_VALUES

    TRUE_VALUES : array

static

var |

### Type(s)

`array`

## FALSE_VALUES

    FALSE_VALUES : array

static

var |

### Type(s)

`array`