Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
4 views

Java String

Uploaded by

PRODYOT SINHA
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views

Java String

Uploaded by

PRODYOT SINHA
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

chat charAt (int index)

Returns the char value at the specified index


int
compareTo (StrLng anothérstring)
Compares two strings lexicographically.
int. conpareTognoreCase (String str)
Compares two strings lexicographically, ignoring case ifferences.
boolean endsWith (String suffix)
Tests if this string ends with the specified suffix.
boolean equals (Object anobject)
Compares this string to the specified object.
boolean equalsIgnoreCase (String anothe rSt ring)
Compares this string to another string, ignoring case considerations.
int /ndexof (int ch)
Returns the index within this string of the first occurrence of the
specified character.
int indexof (int ch, int fromIndex)
Returns the index within this string of the first occurrence of the
specified character, starting the search at the specified index.
int indexof (St ring str)
Returns the index within this string of the first occurrence of the
specified substring.
int index0f (String str, int fromIndex)
Returns the index within this string of the first occurrence of the
specified substring, starting at the specified index.
nt lastIndexOf (int ch)
Returns the index within this string of the last occurrence of the
speciftièd character.
int lastIndex0f (String str)
Returns the index within this string of the rightnost occurrence of the
specified substring.
in: length ()
Returns the length of this string.
Strlng ceplace (char oldChar, char newChar)
Returns a new string resulting from replacing all occurrences of
oldChar in this string with newChar.
Stringl} split (String regez)
Splits this string around matches of the given regular expression.
String[I split(String regex, int limit)
Splits this string around matches of the given regular expression.
String substring(int beginIndex)
Returnsa new string that is a substring of this string.
String substring (int beginIndex, int endIndez)
Returns a new string that is a substring of this string.
char[] toCharArray ()
Converts this string to a new character array.
String |toLowerCase ()
Converts all of the characters in this String to lower case uei
rules of the default locale.
Stringi tostring ()
This object (which is already a string!) is itself returned.
String: toUpperCase ()
Converts allof the characters in this string to upper case usin
'rules of the default locale.
String trim()
Returns acopy of the string, with leading and trailing whitespa
omitted.
static Stringivalue0f (boolean b)
Returns the string representation of the boolean argument.
static Stringjvalueof (char c)
Returns the string representation of the char argument.
-static String valueOf (charU data)
Returns the string representation of the char ârray argument.
.static String ivalue0f (char(] data, int offset, int count)
Returns the string representation of a specific subarray of the ch.
jarray argument.
static String value0f (double d)
Returns the string representation of the double argument.
static String value0f (float f)
Returns the string representation of the float argment.
static String value0£ (int i)
Returns the string representation of the int argument.
static String Ëvalueo£ (l ong l)
Returnsthe string representation of the long argunnent.
static String value0f (Object obj)
Returns the string representation of the object
argument.
(StringBufler methods )
StringBuffer append (boolean b)
Appends the string representationof the boolean argument to the
StringBuffer append(char c) sequence.
Appends the string representation of the char argument to this
StringBuffer append (char (] str) sequence.
Appends the string representation of the chararray argument to this
StringBuffer append(char[) str, int offset, int len)
sequence.
Appends the string representation of a subarray of the char array
thissequence. argument to
StringBuffer append (double d)
Appends the string representation of the double argunent to this
StringBuffer append (fl oat f) sequence.
Appends the string representation of the float argument to
StringBuffer append(int i) this sequence.
Appends the string representation of the int argument to this
StringBuffer append (long lng) sequence.
Appends the string representation of the long arguinent to
this sequence.
StringBuffer append (0bject obj)
Appends the string representation of the object argument.
StringBuffer append (String str)
Appends the specified string to this character sequence.
StringBuffer append (StringBuffer sb)
Appends the specified stringBuffer to this sequence.
int capacity )
Returns the current capacity.
char charAt.(int index)
Returns the char value in this sequence at the
specified index
StringBuffer delete (int start, int end)
Removes the characters in a substring of this sequence.
$tringBuffer deleteCharAt (int index)
Removes the char at the specified position in this
void getChars (int srcBegin, int sequence.
srcEnd, char(] dst, int dstBegin)
Characters are copied fronm this sequence into the destination
dst. character array
int índex0£ (3tring str)
Returns the index within this string of the first
substring. occurrence of the specified
intindex0£ (String str, int fromIndex)
Returns the index within this string of the first
substring, starting at the specified index. occurrence of the specified
ringBuffer insert (int offset, boolean b)
Inserts the string representation ol the
boolean argument into this sequence
ringBuffer insert (int offset, char c)
Insertsthe string representation of the ch£r
argunlent
into tlus sequence.
(StringBuffer methods )
StringBuf fer insert (int offset, char() str)
Inserts the string representation of the char
StringBuf fer insert (int index, char(J str, int of fset, array int len! argument into thy
Inserts the string representation of asubarray of
this sequence. the str
StringBuffer insert (int offset, double d)
array argur
Inserts the string representation of the
StringBuffer insert (int offset, float f) double argument into
Inserts the string representation of the float
this ser
StringBuffer insert (int offset, int i) argument into this
Inserts the string representation of the second sequ
int
StringBuffer insert (int offset, long 1) argument into thig
Inserts the string representation of the long
StringBuffer insert (int offset, .object obj ) argument into thhis
Inserts the string representation of the seque
Sequence. Object argument into this ol.
StringBuffer insert (int offset, String str)
Inserts the string into this character
int sequence.
lastIndex0£ (String str)
Returns the index within this string of the
specified substring. rightmost occurrence of the
int length()
Returns the length (character count).
StringBuffer
-

replace (int start, int end, String str)


Replaces the characters in a substring of this sequence with characters
specified string.
StringBuffer reverse ()
Causes this character sequence to be replaced by
void setCharAt (int index, the reverse of the seq
char ch)
The character at the specified
index is set to ch.
String substring (int start)
Returns a new String that contains a
contained in this character sequence. subscquence of characterscile
String substring(int start int end)1 3 1 s N n n t
Returns a new String that contains asubsequence of characters CUrre
contained in this sequence.
String tostring ()
Returns a string representing the data in this
void trinToSize ( sequence.
Attempts to reduce storage used for the
character sequence

You might also like