classes/phing/util/StringHelper.php
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
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
Properties
Methods



endsWith(
$check, $string
)
:
statictests if a string ends with a given string
Parameters
| Name |
Type |
Description |
| $check |
|
|
| $string |
|
|



hashCode(
$string
)
:
intstatic
Parameters
| Name |
Type |
Description |
| $string |
|
|
Returns



isSlotVar(
string $value
)
:
staticDoes the value correspond to a slot variable?
Parameters
| Name |
Type |
Description |
| $value |
string |
|



multiply(
array $strings, array $tokens, array $replacements
)
:
string
staticReplaces identifier tokens with corresponding text values in passed string.
Parameters
| Name |
Type |
Description |
| $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



prefix(
array $columns, string $prefix
)
:
arraystatic
Parameters
| Name |
Type |
Description |
| $columns |
array |
String[]
|
| $prefix |
string |
|
Returns



root(
$qualifiedName, $separator
=
.
)
:
stringstatic
Parameters
| Name |
Type |
Description |
| $qualifiedName |
|
|
| $separator |
|
|
Returns



slotVar(
string $var
)
:
string
staticExtracts the variable name for a slot var in the format %{task.current_file}
Parameters
| Name |
Type |
Description |
| $var |
string |
The var from build file. |
Returns



startsWith(
$check, $string
)
:
statictests if a string starts with a given string
Parameters
| Name |
Type |
Description |
| $check |
|
|
| $string |
|
|



substring(
$string, $startpos, $endpos
)
:
statica 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
Parameters
| Name |
Type |
Description |
| $string |
|
|
| $startpos |
|
|
| $endpos |
|
|



toCharArray(
$str
)
:
array
staticConverts 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.
Parameters
| Name |
Type |
Description |
| $str |
|
|
Returns
Details
- deprecated