BBjString::indexOf
Description
In BBj 7.0 and higher, this method returns the index within this string of the first occurrence of the specified character. If a character with value ch occurs in the character sequence represented by this String object, then the index (in Unicode code units) of the first such occurrence is returned. For values of ch in the range from 0 to 0xFFFF (inclusive), this is the smallest value k such that:
is true. For other values of ch, it is the smallest value k such that:this.charAt(k) == ch
is true. For other values of ch, it is the smallest value k such that:
this.codePointAt(k) == ch
is true. In either case, if no such character occurs in this string, then -1 is returned.
Syntax
Return Value | Method |
---|---|
int | indexOf(int ch) |
int | indexOf(int ch, int fromIndex) |
int | indexOf(string str) |
int | indexOf(string str, int fromIndex) |
Parameters
Variable | Description |
---|---|
ch | A character (Unicode code point). |
fromIndex | The index to start the search from. |
str | The substring to search for. |
Return Value
Returns the index of the first occurrence of the character in the character sequence represented by this string, or -1 if the character does not occur.
Remarks
None.
Example
|
See Also
See the BBj Object Diagram for an illustration of the relationship between BBj Objects.