Class RSStringUtil

Description

A Utility Class for Manipulating Strings.

General order of arguments for all methods:
The string to operate on is always the first argument.

Located in /code/framework/RSStringUtil/RSStringUtil.php (line 42)


	
			
Method Summary
int bytesToKiloBytes (mixed $byte, [mixed $precision = 1])
void lastIndexOf (String $str, String $search)
String limit (String $str, mixed $limit, [mixed $appendString = '...'])
String removeLeadingString (String $str, mixed $leading)
String removeTrailingString (String $str, mixed $trailing)
Methods
bytesToKiloBytes (line 78)

Returns the first argument divided by 1024 with a precision specified by the second argument. If the second argument is not present the default of 1 is assumed.

  • return: The first argument divided by 1024.
int bytesToKiloBytes (mixed $byte, [mixed $precision = 1])
  • mixed $byte: Number of bytes.
lastIndexOf (line 104)

Returns the index of the last occurrence of the string passed as second argument in the string passed as first argument.

void lastIndexOf (String $str, String $search)
  • String $str
  • String $search
limit (line 91)

Returns the first argument limited to as many characters as specified by the second argument.

The third argument is appended to the limited string. Its default is '...'.

  • return: The limited string with the third argument appended.
String limit (String $str, mixed $limit, [mixed $appendString = '...'])
  • String $str: The string to limit.
removeLeadingString (line 65)

Returns the string passed as argument with the leading dollar sign ($) removed removed.

String removeLeadingString (String $str, mixed $leading)
  • String $str
removeTrailingString (line 52)

Returns the string passed as argument with the trailing slash removed.

If the passed string does not end with a slash the passed string is returned without modification. NOTE: This method only deals with foreward slashes (/).

String removeTrailingString (String $str, mixed $trailing)
  • String $str

Documentation generated on Mon, 8 Dec 2003 13:13:09 +0100 by phpDocumentor 1.2.3