JString
String handling class for utf-8 data Wraps the phputf8 library All functions assume the validity of utf-8 strings.
Located in /joomla/utilities/string.php (line 32)
JString (Subpackage Utilities)
UTF-8 aware replacement for ltrim()
Strip whitespace (or other characters) from the beginning of a string Note: you only need to use this if you are supplying the charlist optional arg and it contains UTF-8 characters. Otherwise ltrim will work normally on a UTF-8 string
- string $str: the string to be trimmed
- string $charlist: the optional charlist of additional characters to trim
UTF-8 aware replacement for rtrim()
Strip whitespace (or other characters) from the end of a string Note: you only need to use this if you are supplying the charlist optional arg and it contains UTF-8 characters. Otherwise rtrim will work normally on a UTF-8 string
- string $str: the string to be trimmed
- string $charlist: the optional charlist of additional characters to trim
UTF-8 aware alternative to strcasecmp A case insensivite string comparison
- string $str1: string 1 to compare
- string $str2: string 2 to compare
UTF-8 aware alternative to strcspn Find length of initial segment not matching mask
- string $str
- string $mask: the mask
- int $start: Optional starting character position (in characters)
- int $length: Optional length
UTF-8 aware alternative to stristr Returns all of haystack from the first occurrence of needle to the end.
needle and haystack are examined in a case-insensitive manner Find first occurrence of a string using case insensitive comparison
- string $str: the haystack
- string $search: the needle
UTF-8 aware alternative to strlen Returns the number of characters in the string (NOT THE NUMBER OF BYTES),
- string $str: UTF-8 string
UTF-8 aware alternative to strpos Find position of first occurrence of a string
- $str $str: - string String being examined
- $search $search: - string String being searced for
- $offset $offset: - int Optional, specifies the position from which the search should be performed
UTF-8 aware alternative to strrev Reverse a string
- string $str: String to be reversed
UTF-8 aware alternative to strrpos Finds position of last occurrence of a string
- $str $str: - string String being examined
- $search $search: - string String being searced for
UTF-8 aware alternative to strspn Find length of initial segment matching mask
- string $str: the haystack
- string $mask: the mask
- int $start: start optional
- int $length: length optional
UTF-8 aware alternative to strtlower
Make a string lowercase Note: The concept of a characters "case" only exists is some alphabets such as Latin, Greek, Cyrillic, Armenian and archaic Georgian - it does not exist in the Chinese alphabet, for example. See Unicode Standard Annex #21: Case Mappings
- string $str
UTF-8 aware alternative to strtoupper
Make a string uppercase Note: The concept of a characters "case" only exists is some alphabets such as Latin, Greek, Cyrillic, Armenian and archaic Georgian - it does not exist in the Chinese alphabet, for example. See Unicode Standard Annex #21: Case Mappings
- string $str
UTF-8 aware alternative to str_ireplace Case-insensitive version of str_replace
- string $search: string to search
- string $replace: existing string to replace
- string $str: new string to replace with
- int $count: optional count value to be passed by referene
UTF-8 aware alternative to str_split Convert a string to an array
- string $str: UTF-8 encoded
- int $split_len: number to characters to split string by
UTF-8 aware alternative to substr Return part of a string given character offset (and optionally length)
- string $str
- integer $offset: number of UTF-8 characters offset (from left)
- integer $length: (optional) length in UTF-8 characters from offset
UTF-8 aware substr_replace Replace text within a portion of a string
- string $str: the haystack
- string $repl: the replacement string
- int $start: start
- int $length: length (optional)
Transcode a string.
- string $source: The string to transcode.
- string $from_encoding: The source encoding.
- string $to_encoding: The target encoding.
UTF-8 aware replacement for trim()
Strip whitespace (or other characters) from the beginning and end of a string Note: you only need to use this if you are supplying the charlist optional arg and it contains UTF-8 characters. Otherwise trim will work normally on a UTF-8 string
- string $str: the string to be trimmed
- string $charlist: the optional charlist of additional characters to trim
UTF-8 aware alternative to ucfirst Make a string's first character uppercase
- string $str
UTF-8 aware alternative to ucwords Uppercase the first character of each word in a string
- string $str
Documentation generated on Mon, 05 Mar 2007 21:27:04 +0000 by phpDocumentor 1.3.1