Resin 1.1
FAQ
Reference
JavaDoc
Demo
Java Tutorial
Getting Started
Configuration
Topics
JSP
XTP/XSL
JavaScript
JS Library
Core Library
File Library
Servlet Library
Database Library
XML Library
Global
Object
Array
Boolean
Date
Function
Math
Number
Regexp
String
Printf
The String Object
String Constructor
String(arg) | Converts arg to a string.
String(arg) | Creates a string object with value arg converted to a string.
String.fromCharCode(c1, ..., cn) | Creates a new string based on the numeric values given as arguments.
String.printf(fmt [, ...]) | Creates a new string formatted as the C printf call.
String Instance
charAt([index]) | Returns a string representing the character at `index`.
charCodeAt([index]) | Returns the character code at the given index.
concat(string) | Creates a new string concatenating the two strings.
indexOf(match [, index]) | Returns the first index of `match` in the string. The search starts at `index` if given.
lastIndexOf(match [, index]) | Returns the last index of `match` in the string. The search starts at `index` if given.
match(regexp) | Matches against a regular expression.
replace(regexp, replacement) | Replaces matching substrings with `replacement`.
search(regexp) | Returns the index of the next regular expression match.
slice(begin [, end]) | `slice` returns the substring from `begin` to `end`.
split([separator [, limit]]) | Splits the string based on the separator. The separator can be a string or a regular expression.
substr(begin [, length]) | Returns the substring from begin with the given length.
substring(indexA [, indexB]) | Returns the substring from indexA to indexB.
toLowerCase() | Returns a new string converting all characters to their lowercase equivalent.
toUpperCase() | Returns a new string converting all characters to their uppercase equivalent.
String Constructor
### String(arg)
Converts arg to a string.
String(true).toSource() + " " + typeof String(true)
"true" string
### String(arg)
Creates a string object with value arg converted to a string.
new String(true).toSource() + " " + typeof new String(true)
new String("true") object
### String.fromCharCode(c1, ..., cn)
Creates a new string based on the numeric values given as arguments.
### String.printf(fmt [, ...]) | ### Resin 1.0
Creates a new string formatted as the C printf call. See printf formatting for details.
String.printf("%.4x")
| '0cab'
String.printf("%.2d")
| '01'
String.printf("%05.2f%%")
| '01.65%'

String Instance

### charAt([index])

Returns a string representing the character at `index`.

### charCodeAt([index])

Returns the character code at the given index.

### concat(string) | ### JavaScript 1.2

Creates a new string concatenating the two strings.

### indexOf(match [, index])

Returns the first index of `match` in the string. The search starts at `index` if given.

### lastIndexOf(match [, index])

Returns the last index of `match` in the string. The search starts at `index` if given.

### match(regexp) | ### JavaScript 1.2

Matches against a regular expression. If `regexp` has the global flag set, `match` returns an array of all the matches in the string. If the global flag is clear, `match` returns an array of the match and the submatches.

`match` always sets the regular expression values like exec.

### replace(regexp, replacement) | ### JavaScript 1.2

Replaces matching substrings with `replacement`. If `replacement` is a function, the function generates the replacement string. The function's arguments are the matched subexpressions.

### search(regexp) | ### JavaScript 1.2

Returns the index of the next regular expression match.

### slice(begin [, end]) | ### JavaScript 1.2

`slice` returns the substring from `begin` to `end`. Negative indices count from the end of the string.

### split([separator [, limit]])

Splits the string based on the separator. The separator can be a string or a regular expression.

### substr(begin [, length]) | ### JavaScript 1.2

Returns the substring from begin with the given length. If begin is negative, it counts from the end of the string.

### substring(indexA [, indexB])

Returns the substring from indexA to indexB. If either index is negative, it is treated as 0. If indexB is less than indexA they are swapped.

### toLowerCase()

Returns a new string converting all characters to their lowercase equivalent.

### toUpperCase()

Returns a new string converting all characters to their uppercase equivalent.

Regexp |  | Printf

Copyright © 1998-2000 Caucho Technology. All rights reserved.
Last modified: Thu, 16 Sep 1999 14:56:49 -0700 (PDT)