THE PACKAGE JAVA.LANG
java.lang.String
20.12
20.12.24
public int indexOf(int ch, int fromIndex)
If a character with value
ch
occurs in the character sequence represented by this
String
object at an index no smaller than
fromIndex
, then the index of the first
such occurrence is returned that is, the smallest value
k
such that:
(this.charAt(k) == ch) && (k >= fromIndex)
is
true
. If no such character occurs in this string at or after position
fromIndex
,
then
1
is returned.
There is no restriction on the value of
fromIndex
. If it is negative, it has the
same effect as if it were zero: this entire string may be searched. If it is greater
than the length of this string, it has the same effect as if it were equal to the length
of this string:
1
is returned.
20.12.25
public int indexOf(String str)
throws NullPointerException
If the string
str
occurs as a substring of this
String
object, then the index of the
first character of the first such substring is returned that is, the smallest value
k
such that:
this.startsWith(str, k)
is
true
. If
str
does not occur as a substring of this string, then
1
is returned.
If
str
is
null
, a
NullPointerException
is thrown.
20.12.26
public int indexOf(String str, int fromIndex)
throws NullPointerException
If the string
str
occurs as a substring of this
String
object starting at an index no
smaller than
fromIndex
, then the index of the first character of the first such sub
string is returned that is, the smallest value
k
such that:
this.startsWith(str, k) && (k >= fromIndex)
is
true
. If
str
does not occur as a substring of this string at or after position
fromIndex
, then
1
is returned.
There is no restriction on the value of
fromIndex
. If it is negative, it has the
same effect as if it were zero: this entire string may be searched. If it is greater
than the length of this string, it has the same effect as if it were equal to the length
of this string:
1
is returned.
If
str
is
null
, a
NullPointerException
is thrown.
541
footer
Our partners:
PHP: Hypertext Preprocessor Best Web Hosting
Java Web Hosting
Inexpensive Web Hosting
Jsp Web Hosting
Cheapest Web Hosting
Jsp Hosting
Cheap Hosting
Visionwebhosting.net Business web hosting division of Web
Design Plus. All rights reserved