| java.lang.Object com.caucho.quercus.module.AbstractQuercusModule com.caucho.quercus.lib.string.StringModule
Inner Class :static class StrtrComparator implements Comparator<T> | |
Inner Class :abstract static class PrintfSegment | |
Inner Class :static class TextPrintfSegment extends PrintfSegment | |
Inner Class :static class LongPrintfSegment extends PrintfSegment | |
Inner Class :static class HexPrintfSegment extends PrintfSegment | |
Inner Class :static class DoublePrintfSegment extends PrintfSegment | |
Inner Class :static class StringPrintfSegment extends PrintfSegment | |
Inner Class :static class CharPrintfSegment extends StringPrintfSegment | |
Inner Class :static class SimpleStringReader | |
Method Summary | |
public static StringValue | addcslashes(StringValue source, String characters) Escapes a string using C syntax. | public static StringValue | addslashes(StringValue source) Escapes a string for db characters. | public static StringValue | bin2hex(Env env, InputStream is) Converts a binary value to a hex value. | public static StringValue | chop(Env env, StringValue str, String charset) Alias of rtrim. | public static String | chr(long value) | public static String | chunk_split(String body, int chunkLen, String end) | public static String | convert_cyr_string(Env env, String str, String from, String to) Converts from one cyrillic set to another. | public static Value | convert_uudecode(Env env, String source) | public static Value | convert_uuencode(StringValue source) uuencode a string. | public static Value | count_chars(StringValue data, int mode) Returns an array of information about the characters. | public static long | crc32(InputStream is) | public static String | crypt(String string, String salt) | public static Value | explode(StringValue separator, StringValue string, long limit) | public static Value | fprintf(Env env, BinaryOutput os, StringValue format, Value[] args) Use printf style formatting to write a string to a file. | protected static int | hexToDigit(char ch) | public static Value | implode(Env env, Value glueV, Value piecesV) | protected static boolean | isWhitespace(char ch) Returns true if the character is a whitespace character. | public static Value | join(Env env, Value glueV, Value piecesV) | public static ArrayValue | localeconv(Env env) Gets locale-specific symbols. | public static StringValue | ltrim(Env env, StringValue string, String characters) Removes leading whitespace. | public static StringValue | md5(Env env, InputStream is, boolean rawOutput) | public static Value | md5_file(Env env, Path source, boolean rawOutput) | public static String | metaphone(String string) Returns the metaphone of a string. | public static String | money_format(Env env, String format, double value) Returns a formatted money value. | public static String | number_format(Env env, double value, int decimals, Value pointValue, Value groupValue) Returns a formatted number. | protected static int | octToDigit(char ch) | public static long | ord(StringValue string) Converts the first character to an integer. | public static Value | parse_str(Env env, String str, Value ref) Parses the string as a query string. | public static long | print(Env env, Value value) Prints the string. | public static int | printf(Env env, StringValue format, Value[] args) | public static String | quoted_printable_decode(String str) Converts a RFC2045 quoted printable string to a string. | public static Value | quotemeta(StringValue string) Escapes meta characters. | public static StringValue | rtrim(Env env, StringValue string, String characters) Removes trailing whitespace. | public static Value | setlocale(Env env, int category, Value localeArg, Value[] fallback) Sets locale configuration. | public static String | sha1(String source, boolean rawOutput) | public static Value | sha1_file(Env env, Path source, boolean rawOutput) | public static Value | soundex(StringValue string) | public static Value | sprintf(StringValue format, Value[] args) | public static Value | sscanf(Env env, StringValue string, StringValue format, Value[] args) | public static Value | str_ireplace(Env env, Value search, Value replace, Value subject, Value count) replaces substrings. | public static StringValue | str_pad(StringValue string, int length, String pad, int type) | public static Value | str_repeat(StringValue string, int count) | public static Value | str_replace(Env env, Value search, Value replace, Value subject, Value count) replaces substrings. | public static Value | str_rot13(StringValue string) | public static String | str_shuffle(String string) | public static Value | str_split(StringValue string, int chunk) | public static Value | str_word_count(StringValue string, int format, String additionalWordCharacters) | public static int | strcasecmp(StringValue a, StringValue b) | public static Value | strchr(Env env, StringValue haystack, Value needle) | public static int | strcmp(StringValue a, StringValue b) | public static Value | strcoll(String a, String b) | public static Value | strcspn(StringValue string, StringValue characters, int offset, int length) | public static StringValue | strip_tags(StringValue string, String allowTags) Removes tags from a string. | public static String | stripcslashes(String source) Strip out the backslashes, recognizing the escape sequences, octal,
and hexadecimal representations. | public static Value | stripos(StringValue haystack, Value needleV, int offset) Returns the position of a substring, testing case insensitive. | public static StringValue | stripslashes(StringValue string) Strips out the backslashes. | public static Value | stristr(StringValue haystack, Value needleV) | public static Value | strlen(Value value) Returns the length of a string. | public static int | strnatcasecmp(StringValue a, StringValue b) | public static int | strnatcmp(StringValue a, StringValue b) | public static int | strncasecmp(StringValue a, StringValue b, int length) | public static int | strncmp(StringValue a, StringValue b, int length) | public static Value | strpbrk(StringValue haystack, StringValue charList) | public static Value | strpos(StringValue haystack, Value needleV, int offset) Returns the position of a substring. | public static Value | strrchr(StringValue haystack, Value needleV) | public static Value | strrev(StringValue string) Reverses a string. | public static Value | strripos(String haystack, Value needleV, Value offsetV) Returns the position of a substring, testing case-insensitive. | public static Value | strrpos(StringValue haystack, Value needleV, Value offsetV) Returns the position of a substring. | public static Value | strspn(StringValue string, StringValue characters, int offset, int length) | public static Value | strstr(Env env, StringValue haystackV, Value needleV) Finds the first instance of a needle in haystack and returns
the portion of haystack from the beginning of needle to the end of haystack. | public static Value | strtok(Env env, StringValue string1, Value string2) Split a string into tokens using any character in another string as a delimiter. | public static StringValue | strtolower(StringValue string) Converts to lower case. | public static StringValue | strtoupper(StringValue string) Converts to upper case. | public static StringValue | strtr(Env env, StringValue string, Value fromV, StringValue to) Translates characters in a string to target values. | public static Value | substr(Env env, StringValue string, int start, Value lenV) | public static Value | substr_compare(Env env, StringValue mainStr, StringValue str, int offset, Value lenV, boolean isCaseInsensitive) | public static Value | substr_count(Env env, StringValue haystackV, StringValue needleV, int offset, int length) | public static Value | substr_replace(Value subjectV, StringValue replacement, Value startV, Value lengthV) | protected static char | toHexChar(int d) | protected static char | toUUChar(int d) Converts an integer digit to a uuencoded char. | protected static char | toUpperCase(char ch) | protected static char | toUpperHexChar(int d) | public static Value | trim(Env env, StringValue string, String characters) Removes leading and trailing whitespace. | public static String | ucfirst(String string) | public static String | ucwords(String string) | public static int | vprintf(Env env, StringValue format, ArrayValue array) | public static Value | vsprintf(StringValue format, ArrayValue array) | public static String | wordwrap(String string, int width, String breakString, boolean cut) Wraps a string to the given number of characters. |
CHAR_MAX | final public static int CHAR_MAX(Code) | | |
CRYPT_BLOWFISH | final public static int CRYPT_BLOWFISH(Code) | | |
CRYPT_EXT_DES | final public static int CRYPT_EXT_DES(Code) | | |
CRYPT_MD5 | final public static int CRYPT_MD5(Code) | | |
CRYPT_SALT_LENGTH | final public static int CRYPT_SALT_LENGTH(Code) | | |
CRYPT_STD_DES | final public static int CRYPT_STD_DES(Code) | | |
LC_ALL | final public static int LC_ALL(Code) | | |
LC_COLLATE | final public static int LC_COLLATE(Code) | | |
LC_CTYPE | final public static int LC_CTYPE(Code) | | |
LC_MESSAGES | final public static int LC_MESSAGES(Code) | | |
LC_MONETARY | final public static int LC_MONETARY(Code) | | |
LC_NUMERIC | final public static int LC_NUMERIC(Code) | | |
LC_TIME | final public static int LC_TIME(Code) | | |
STR_PAD_BOTH | final public static int STR_PAD_BOTH(Code) | | |
STR_PAD_LEFT | final public static int STR_PAD_LEFT(Code) | | |
STR_PAD_RIGHT | final public static int STR_PAD_RIGHT(Code) | | |
addslashes | public static StringValue addslashes(StringValue source)(Code) | | Escapes a string for db characters.
Parameters: source - the source string to convert the escaped string |
chop | public static StringValue chop(Env env, StringValue str, String charset)(Code) | | Alias of rtrim. Removes trailing whitespace.
Parameters: env - the quercus environment Parameters: str - the string to be trimmed Parameters: charset - optional set of characters to trim the trimmed string |
chr | public static String chr(long value)(Code) | | converts a number to its character equivalent
Parameters: value - the integer value the string equivalent |
chunk_split | public static String chunk_split(String body, int chunkLen, String end)(Code) | | Splits a string into chunks
Parameters: body - the body string Parameters: chunkLen - the optional chunk length, defaults to 76 Parameters: end - the optional end value, defaults to "\r\n" |
convert_cyr_string | public static String convert_cyr_string(Env env, String str, String from, String to)(Code) | | Converts from one cyrillic set to another.
This implementation does nothing, because quercus stores strings as
16 bit unicode.
|
count_chars | public static Value count_chars(StringValue data, int mode)(Code) | | Returns an array of information about the characters.
|
crc32 | public static long crc32(InputStream is)(Code) | | Calculates the crc32 value for a string
Parameters: str - the string value the crc32 hash |
explode | public static Value explode(StringValue separator, StringValue string, long limit)(Code) | | Explodes a string into an array
Parameters: separator - the separator string Parameters: string - the string to be exploded Parameters: limit - the max number of elements an array of exploded values |
fprintf | public static Value fprintf(Env env, BinaryOutput os, StringValue format, Value[] args)(Code) | | Use printf style formatting to write a string to a file.
Parameters: fd - the file to write to Parameters: format - the format string Parameters: args - the valujes to apply to the format string |
hexToDigit | protected static int hexToDigit(char ch)(Code) | | |
implode | public static Value implode(Env env, Value glueV, Value piecesV)(Code) | | implodes an array into a string
Parameters: glueV - the separator string Parameters: piecesV - the array to be imploded a string of imploded values |
isWhitespace | protected static boolean isWhitespace(char ch)(Code) | | Returns true if the character is a whitespace character.
|
join | public static Value join(Env env, Value glueV, Value piecesV)(Code) | | implodes an array into a string
Parameters: glueV - the separator string Parameters: piecesV - the array to be imploded a string of imploded values |
ltrim | public static StringValue ltrim(Env env, StringValue string, String characters)(Code) | | Removes leading whitespace.
Parameters: string - the string to be trimmed Parameters: characters - optional set of characters to trim the trimmed string |
md5 | public static StringValue md5(Env env, InputStream is, boolean rawOutput)(Code) | | returns the md5 hash
Parameters: source - the string Parameters: rawOutput - if true, return the raw binary a string of imploded values |
md5_file | public static Value md5_file(Env env, Path source, boolean rawOutput)(Code) | | returns the md5 hash
Parameters: source - the string Parameters: rawOutput - if true, return the raw binary a string of imploded values |
metaphone | public static String metaphone(String string)(Code) | | Returns the metaphone of a string.
This implentation produces identical results to the php version, which does contain some bugs.
|
money_format | public static String money_format(Env env, String format, double value)(Code) | | Returns a formatted money value.
Parameters: format - the format Parameters: value - the value a string of formatted values |
number_format | public static String number_format(Env env, double value, int decimals, Value pointValue, Value groupValue)(Code) | | Returns a formatted number.
Parameters: value - the value Parameters: decimals - the number of decimals Parameters: pointValue - the decimal point string Parameters: groupValue - the thousands separator a string of the formatted number |
octToDigit | protected static int octToDigit(char ch)(Code) | | |
ord | public static long ord(StringValue string)(Code) | | Converts the first character to an integer.
Parameters: string - the string to be converted the integer value |
parse_str | public static Value parse_str(Env env, String str, Value ref)(Code) | | Parses the string as a query string.
Parameters: env - the calling environment Parameters: str - the query string Parameters: array - the optional result array |
print | public static long print(Env env, Value value)(Code) | | Prints the string.
Parameters: env - the quercus environment Parameters: value - the string to print |
printf | public static int printf(Env env, StringValue format, Value[] args)(Code) | | print to the output with a formatter
Parameters: env - the quercus environment Parameters: format - the format string Parameters: args - the format arguments the formatted string |
quoted_printable_decode | public static String quoted_printable_decode(String str)(Code) | | Converts a RFC2045 quoted printable string to a string.
|
quotemeta | public static Value quotemeta(StringValue string)(Code) | | Escapes meta characters.
Parameters: string - the string to be quoted the quoted |
rtrim | public static StringValue rtrim(Env env, StringValue string, String characters)(Code) | | Removes trailing whitespace.
Parameters: env - the quercus environment Parameters: string - the string to be trimmed Parameters: characters - optional set of characters to trim the trimmed string |
setlocale | public static Value setlocale(Env env, int category, Value localeArg, Value[] fallback)(Code) | | Sets locale configuration.
|
sha1 | public static String sha1(String source, boolean rawOutput)(Code) | | returns the md5 hash
Parameters: source - the string Parameters: rawOutput - if true, return the raw binary a string of imploded values |
sha1_file | public static Value sha1_file(Env env, Path source, boolean rawOutput)(Code) | | returns the md5 hash
Parameters: source - the string Parameters: rawOutput - if true, return the raw binary a string of imploded values |
sprintf | public static Value sprintf(StringValue format, Value[] args)(Code) | | Print to a string with a formatter
Parameters: format - the format string Parameters: args - the format arguments the formatted string |
sscanf | public static Value sscanf(Env env, StringValue string, StringValue format, Value[] args)(Code) | | scans a string
Parameters: format - the format string Parameters: args - the format arguments the formatted string |
str_ireplace | public static Value str_ireplace(Env env, Value search, Value replace, Value subject, Value count)(Code) | | replaces substrings.
Parameters: search - search string Parameters: replace - replacement string Parameters: subject - replacement Parameters: count - return value |
str_pad | public static StringValue str_pad(StringValue string, int length, String pad, int type)(Code) | | Pads strings
Parameters: string - string Parameters: length - length Parameters: pad - padding string Parameters: type - padding type |
str_repeat | public static Value str_repeat(StringValue string, int count)(Code) | | repeats a string
Parameters: string - string to repeat Parameters: count - number of times to repeat |
str_replace | public static Value str_replace(Env env, Value search, Value replace, Value subject, Value count)(Code) | | replaces substrings.
Parameters: search - search string Parameters: replace - replacement string Parameters: subject - replacement Parameters: count - return value |
str_rot13 | public static Value str_rot13(StringValue string)(Code) | | rot13 conversion
Parameters: string - string to convert |
str_split | public static Value str_split(StringValue string, int chunk)(Code) | | split into an array
Parameters: string - string to split Parameters: chunk - chunk size |
strcasecmp | public static int strcasecmp(StringValue a, StringValue b)(Code) | | Case-insensitive comparison
Parameters: a - left value Parameters: b - right value -1, 0, or 1 |
strchr | public static Value strchr(Env env, StringValue haystack, Value needle)(Code) | | Finds the index of a substring
Parameters: env - the calling environment |
strcmp | public static int strcmp(StringValue a, StringValue b)(Code) | | Case-sensitive comparison
Parameters: a - left value Parameters: b - right value -1, 0, or 1 |
strcoll | public static Value strcoll(String a, String b)(Code) | | Locale-based comparison
XXX: i18n
Parameters: a - left value Parameters: b - right value -1, 0, or 1 |
strcspn | public static Value strcspn(StringValue string, StringValue characters, int offset, int length)(Code) | | Finds the number of initial characters in string that do not match
one of the characters in characters
Parameters: string - the string to search in Parameters: characters - the character set Parameters: offset - the starting offset Parameters: length - the length the length of the match or FALSE if the offset or length are invalid |
strip_tags | public static StringValue strip_tags(StringValue string, String allowTags)(Code) | | Removes tags from a string.
Parameters: string - the string to remove Parameters: allowTags - the allowable tags |
stripcslashes | public static String stripcslashes(String source)(Code) | | Strip out the backslashes, recognizing the escape sequences, octal,
and hexadecimal representations.
Parameters: source - the string to clean See Also: StringModule.addcslashes |
stripos | public static Value stripos(StringValue haystack, Value needleV, int offset)(Code) | | Returns the position of a substring, testing case insensitive.
Parameters: haystack - the full argument to check Parameters: needleV - the substring argument to check Parameters: offsetV - optional starting position |
stripslashes | public static StringValue stripslashes(StringValue string)(Code) | | Strips out the backslashes.
Parameters: string - the string to clean |
stristr | public static Value stristr(StringValue haystack, Value needleV)(Code) | | Finds the first instance of a substring, testing case insensitively
Parameters: haystack - the string to search in Parameters: needleV - the string to search for the trailing match or FALSE |
strlen | public static Value strlen(Value value)(Code) | | Returns the length of a string.
Parameters: value - the argument value |
strnatcasecmp | public static int strnatcasecmp(StringValue a, StringValue b)(Code) | | Case-insensitive comparison
Parameters: a - left value Parameters: b - right value -1, 0, or 1 |
strnatcmp | public static int strnatcmp(StringValue a, StringValue b)(Code) | | Case-sensitive comparison
Parameters: a - left value Parameters: b - right value -1, 0, or 1 |
strncasecmp | public static int strncasecmp(StringValue a, StringValue b, int length)(Code) | | Case-insensitive comparison
Parameters: a - left value Parameters: b - right value -1, 0, or 1 |
strncmp | public static int strncmp(StringValue a, StringValue b, int length)(Code) | | Case-sensitive comparison
Parameters: a - left value Parameters: b - right value -1, 0, or 1 |
strpbrk | public static Value strpbrk(StringValue haystack, StringValue charList)(Code) | | Returns a substring of haystack starting from the earliest
occurence of any char in charList
Parameters: haystack - the string to search in Parameters: charList - list of chars that would trigger match substring, else FALSE |
strpos | public static Value strpos(StringValue haystack, Value needleV, int offset)(Code) | | Returns the position of a substring.
Parameters: haystack - the string to search in Parameters: needleV - the string to search for |
strrchr | public static Value strrchr(StringValue haystack, Value needleV)(Code) | | Finds the last instance of a substring
Parameters: haystack - the string to search in Parameters: needleV - the string to search for the trailing match or FALSE |
strripos | public static Value strripos(String haystack, Value needleV, Value offsetV)(Code) | | Returns the position of a substring, testing case-insensitive.
Parameters: haystack - the full string to test Parameters: needleV - the substring string to test Parameters: offsetV - the optional offset to start searching |
strrpos | public static Value strrpos(StringValue haystack, Value needleV, Value offsetV)(Code) | | Returns the position of a substring.
Parameters: haystack - the string to search in Parameters: needleV - the string to search for |
strspn | public static Value strspn(StringValue string, StringValue characters, int offset, int length)(Code) | | Finds the number of initial characters in string that match one of
the characters in characters
Parameters: string - the string to search in Parameters: characters - the character set Parameters: offset - the starting offset Parameters: length - the length the length of the match or FALSE if the offset or length are invalid |
strstr | public static Value strstr(Env env, StringValue haystackV, Value needleV)(Code) | | Finds the first instance of a needle in haystack and returns
the portion of haystack from the beginning of needle to the end of haystack.
Parameters: env - the calling environment Parameters: haystack - the string to search in Parameters: needleV - the string to search for, or the oridinal value of a character the trailing match or FALSE if needle is not found |
strtok | public static Value strtok(Env env, StringValue string1, Value string2)(Code) | | Split a string into tokens using any character in another string as a delimiter.
The first call establishes the string to search and the characters to use as tokens,
the first token is returned:
strtok("hello, world", ", ")
=> "hello"
Subsequent calls pass only the token characters, the next token is returned:
strtok("hello, world", ", ")
=> "hello"
strtok(", ")
=> "world"
False is returned if there are no more tokens:
strtok("hello, world", ", ")
=> "hello"
strtok(", ")
=> "world"
strtok(", ")
=> false
Calls that pass two arguments reset the search string:
strtok("hello, world", ", ")
=> "hello"
strtok("goodbye, world", ", ")
=> "goodbye"
strtok("world")
=> false
strtok(", ")
=> false
|
strtr | public static StringValue strtr(Env env, StringValue string, Value fromV, StringValue to)(Code) | | Translates characters in a string to target values.
Parameters: string - the source string Parameters: fromV - the from characters Parameters: to - the to character map |
substr | public static Value substr(Env env, StringValue string, int start, Value lenV)(Code) | | Returns a substring
Parameters: env - the calling environment Parameters: string - the string Parameters: start - the start offset Parameters: lenV - the optional length |
substr_replace | public static Value substr_replace(Value subjectV, StringValue replacement, Value startV, Value lengthV)(Code) | | Replaces a substring with a replacement
Parameters: subjectV - a string to modify, or an array of strings to modify Parameters: replacement - the replacement string Parameters: startV - the start offset Parameters: lengthV - the optional length |
toHexChar | protected static char toHexChar(int d)(Code) | | |
toUUChar | protected static char toUUChar(int d)(Code) | | Converts an integer digit to a uuencoded char.
|
toUpperCase | protected static char toUpperCase(char ch)(Code) | | Returns the uppercase equivalent of the caharacter
|
toUpperHexChar | protected static char toUpperHexChar(int d)(Code) | | |
trim | public static Value trim(Env env, StringValue string, String characters)(Code) | | Removes leading and trailing whitespace.
Parameters: string - the string to be trimmed Parameters: characters - optional set of characters to trim the trimmed string |
ucfirst | public static String ucfirst(String string)(Code) | | Uppercases the first character
Parameters: string - the input string |
ucwords | public static String ucwords(String string)(Code) | | Uppercases the first character of each word
Parameters: string - the input string |
vprintf | public static int vprintf(Env env, StringValue format, ArrayValue array)(Code) | | Formatted strings with array arguments
Parameters: format - the format string Parameters: array - the arguments to apply to the format string |
vsprintf | public static Value vsprintf(StringValue format, ArrayValue array)(Code) | | Formatted strings with array arguments
Parameters: format - the format string Parameters: array - the arguments to apply to the format string |
wordwrap | public static String wordwrap(String string, int width, String breakString, boolean cut)(Code) | | Wraps a string to the given number of characters.
Parameters: string - the input string Parameters: width - the width Parameters: breakString - the break string Parameters: cut - if true, break on exact match |
|
|