Java Learning Made Easy by Dheeraj Mehrotra - HTML preview

PLEASE NOTE: This is an HTML preview only and some elements such as links or page numbers may be incorrect.
Download the book in PDF, ePub, Kindle for a complete version.

in JAVAFORMAT:

02361.jpg02362.jpga1.equals(a2);
i). toLowerCase;USAGE:

 

02363.jpgFORMAT: This method gives ‘true’ if a1 string is equal to a2. a2=a1.toLowerCase;

 

02364.jpg(vi). length();

 

02365.jpgUSAGE: FORMAT:

 

02366.jpgThis function/method converts all the

 

02367.jpga1.length();
characters of the string in lowercase.

(ii). toUpperCase;
FORMAT:
a2=a1.toUpperCase;
USAGE:

02368.jpg

This function returns the length of characters present in the string.

02369.jpg

(vii). ChartAt();

FORMAT:

 

02370.jpgUSAGE:

 

02371.jpg02372.jpga1.ChartAt(n);This function/method is used to convert all USAGE:

 

02373.jpgthe characters of the string a1 into

 

02374.jpguppercase. This function/method returns nth character of the (iii). replace();string a1.

 

02375.jpg(viii). concat();

 

02376.jpgFORMAT:

 

02377.jpgFORMAT:

 

02378.jpga2 = a1.replace(‘n’,’m’);

USAGE:

02379.jpg

a1.concat(a2);

USAGE:

 

02380.jpgThis function replaces all the occurances of the character ‘n’ with ‘m’ in the string a1. (iv). trim();

This function concatenates a1 and a2 strings.

02381.jpg

(ix). substring()

02382.jpg02383.jpg

FORMAT:

02384.jpgFORMAT:
02385.jpga1.substring(n);
02386.jpga2=a1.trim();USAGE:
02387.jpgUSAGE: This function is used to remove all This returns substring starting from the nth 02388.jpgthe white spaces at the beginning and end of character of the string a1.
02389.jpgthe string a1.
02390.jpg02391.jpgattention@computerscienceexpertise.com
02392.jpg02393.jpg02394.jpg02395.jpg
02396.jpg02397.jpg02398.jpg02399.jpg02400.jpg02401.jpg02402.jpg02403.jpg02404.jpg02405.jpg02406.jpg02407.jpg02408.jpg02409.jpg02410.jpg02411.jpg