TLString Class Reference

String manipulation class. More...

List of all members.

Static Public Member Functions

static explodeAssign ($string, $seperator, $vars)
 Split string using a seperator and assign the resulting parts to variables.
static arrayAssign ($array, $vars)
 Assign the elements in an array to separate variables.
static isOfChars ($string, $chars)
 Check if a string consists of (and only of) a bunch of characters.
static startsWith ($string, $start)
 Check if a string starts with a certain other string.
static endsWith ($string, $end)
 Check if a string ends with a certain other string.


Detailed Description

String manipulation class.

Various string manipulation stuff. Please note that this is NOT A GENERIC STRING CLASS! This may also very well clash with other user libraries.

Definition at line 68 of file tlib.php.


Member Function Documentation

static TLString::arrayAssign ( array,
vars 
) [static]

Assign the elements in an array to separate variables.

 $foo = array('bar', 'bas');
 TLString::arrayAssign($foo, (&$bar, &$bas) );

Parameters:
$array (array) Array of which to assign elements
$vars (ass. array) Associative array containing pass-by-reference variables to which to asign the parts of the exploded string. Number of vars must be equal to the number of parts that are the result of the split (or false will be returned).
Returns:
True if the parts were succesfully assigned to the variables in $var. False if otherwise.
Postcondition:
The values of the variables in $var will be assigned the values of the elements in $array
Note:
Variables in $vars must be passed by reference. That is: array(&$var1, &$var2), not array($var1, $var2)!

Definition at line 113 of file tlib.php.

static TLString::endsWith ( string,
end 
) [static]

Check if a string ends with a certain other string.

Parameters:
$string (string) String to check end of.
$end (string) End value.
Returns:
True if $string ends with $end. False otherwise.
Note:
Case-sensitive.

Definition at line 162 of file tlib.php.

static TLString::explodeAssign ( string,
seperator,
vars 
) [static]

Split string using a seperator and assign the resulting parts to variables.

Example:

 $foo = "foo,bar,bas";
 TLString::explodeAssign($foo, ",", (&foo, &$bar, &$bas) );

Parameters:
$string (string) String to split.
$seperator (char) Character to split on.
$vars (ass. array) Associative array containing pass-by-reference variables to which to asign the parts of the exploded string. Number of vars must be equal to the number of parts that are the result of the split (or false will be returned).
Returns:
True if the parts were succesfully assigned to the variables in $var. False if otherwise.
Postcondition:
The values of the variables in $var will be assigned the parts that resulted from the splitting of $string.
Note:
Variables in $vars must be passed by reference. That is: array(&$var1, &$var2), not array($var1, $var2)!

Definition at line 86 of file tlib.php.

static TLString::isOfChars ( string,
chars 
) [static]

Check if a string consists of (and only of) a bunch of characters.

Parameters:
$string (string) String to check. Must be a string otherwise return value may not be correct.
$chars (string) Collection of character to check for. Ranges can be defined by using a-z.
Returns:
True if $string consists of (and only of) characters in $chars. False otherwise.
Note:
Case-sensitive.

If you want to check for a dash ('-'), you must escape it: isOfChars("-hey-", "a-z\-")

Definition at line 133 of file tlib.php.

static TLString::startsWith ( string,
start 
) [static]

Check if a string starts with a certain other string.

Parameters:
$string (string) String to check start of.
$start (string) Start value.
Returns:
True if $string starts with $start. False otherwise.
Note:
Case-sensitive.

Definition at line 145 of file tlib.php.


The documentation for this class was generated from the following file:
Generated on Sun Sep 24 22:05:25 2006 for TLib-PHP by  doxygen 1.4.7