Tag Archives: Java Io

trim in JAVA – JAVA 10th Class notes – ICSE JAVA Notes

trim in JAVA – JAVA 10th Class notes – ICSE JAVA Notes trim( ) : trim( ) function is used to remove the blank spaces form either side of the string. The Blank spaces that are available in between the words, remain unchanged.   Syntax : String var= str.trim();   Example : String str= “  […]

substring(int beginindex, int endindex) in JAVA – JAVA 10th Class notes – ICSE JAVA Notes

substring(int beginindex, int endindex) in JAVA – JAVA 10th Class notes – ICSE JAVA Notes substring(int beginindex, int endindex) : substring(int beginindex, int endindex) function is used to extract a part of the string. This extracted part of the main string is known as the Substring. Syntax : String var=str.substring(index); Example : String str= “COMPUTER”; […]

replace( char oldch, char newch) in JAVA – JAVA 10th Class notes – ICSE JAVA Notes

replace( char oldch, char newch)  in JAVA – JAVA 10th Class notes – ICSE JAVA Notes   replace( char oldch, char newch) : replace( char oldch, char newch) function replaces all the occurrences of the specified old character with the new character within the given String.   Syntax : String res=str.replace (oldch, newch);   Example : […]

Length in JAVA – JAVA 10th Class notes – ICSE JAVA Notes

Length  in JAVA – JAVA 10th Class notes – ICSE JAVA Notes length() : length() function is used to find the length of the String, that is the number of characters present in the String. It returns a Integer Value, as length is a integer number. Syntax : int var = str.length(); Example : String […]

Character is LastIndexOf (char ch) in JAVA – JAVA 10th Class notes – ICSE JAVA Notes

Character is LastIndexOf (char ch) in JAVA – JAVA 10th Class notes – ICSE JAVA Notes lastIndexOf(Char ch) : lastIndexOf(Char ch) function returns the Index of the last occurrence of the specified character within the String. It returns a Integer Value. Syntax : int var = str.lastIndexOf(ch); Example : String str= “JAVA”; int res=str. lastIndexOf […]

Character is indexOf (char ch) in JAVA – JAVA 10th Class notes – ICSE JAVA Notes

Character is indexOf (char ch) in JAVA – JAVA 10th Class notes – ICSE JAVA Notes   indexOf(char ch) : indexOf(char ch) function returns the Index of the first occurrence of the specified character within the String. It returns a Integer Value. Syntax : int var = str.indexOf(ch); Example : String str= “JAVA”; int res=str.indexOf(‘A’); […]

Character is ends with (Stringstr str) in JAVA – JAVA 10th Class notes – ICSE JAVA Notes

Character is ends with (Stringstr str) in JAVA – JAVA 10th Class notes – ICSE JAVA Notes   endsWith(String str) : endsWith(String str) function is used to check whether a given string has specified suffix or not. It returns a Boolean type value. Syntax : boolean b = str.endsWith(str_suffix); Example : String str = “ […]

Character is concat (Stringstr str) in JAVA – JAVA 10th Class notes – ICSE JAVA Notes

Character is concat (Stringstr str) in JAVA – JAVA 10th Class notes – ICSE JAVA Notes   concat(String str) : concat(String str) function is applied to join two Strings. Syntax : String str = str1.concat(str2); Example : String str1 = “ Java”; String str2 = “ Programmer”; String str = str1.concat(str2); Output : Java Programmer […]

Character is compare To (Stringstr) in JAVA – JAVA 10th Class notes – ICSE JAVA Notes

Character is compare To (Stringstr) in JAVA – JAVA 10th Class notes – ICSE JAVA Notes   compareTo(String str) : compareTo(String str) function compares two strings. It not only checks for the equality of the string but also checks whether one string is bigger or smaller than other or not. If the Strings are equal […]

Character is charAt (int index) in JAVA – JAVA 10th Class notes – ICSE JAVA Notes

Character is charAt (int index) in JAVA – JAVA 10th Class notes – ICSE JAVA Notes   charAt(int index) : charAt(int index) function returns a characters from the given position of the String.   Syntax : char variable = variable.charAt(index);   Example : String str = “COMPUTERS”; char ch = str.charAt(3); Output : P Here […]