THE PACKAGE JAVA.LANG
java.lang.String
20.12
this.startsWith(str, k) && (k <= fromIndex)
is
true
. If
str
 does not occur as a substring of this string at or before position
fromIndex
, then
 1
 is returned.
There is no restriction on the value of
fromIndex
. 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: this entire string may be searched. If it is negative, it has the same effect as
if it were
 1
:
 1
 is returned.
If
str
 is
null
, a
NullPointerException
 is thrown.
20.12.31
public String substring(int beginIndex)
throws IndexOutOfBoundsException
The result is a newly created
String
 object that represents a subsequence of the
character sequence represented by this
String
 object; this subsequence begins
with the character at position
beginIndex
 and extends to the end of the character
sequence.
If
beginIndex
 is negative or larger than the length of this
String
 object, then
an
IndexOutOfBoundsException
 is thrown.
Examples:
"unhappy".substring(2)
returns
 "happy"
"Harbison".substring(3)
returns
 "bison"
"emptiness".substring(9)
returns
 ""
(an empty string)
20.12.32
public String substring(int beginIndex, int endIndex)
throws IndexOutOfBoundsException
The result is a newly created
String
 object that represents a subsequence of the
character sequence represented by this
String
 object; this subsequence begins
with the character at position
beginIndex
 and ends with the character at position
endIndex 1
. Thus, the length of the subsequence is
endIndex beginIndex
.
If
beginIndex
 is negative, or
endIndex
 is larger than the length of this
String
 object, or
beginIndex
 is larger than
endIndex
, then this method throws
an
IndexOutOfBoundsException
.
Examples:
"hamburger".substring(4, 8)
returns
 "urge"
"smiles".substring(1, 5)
returns
 "mile"
543






footer




 

 

 

 

 Home | About Us | Network | Services | Support | FAQ | Control Panel | Order Online | Sitemap | Contact

java hosting

 

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