Tag Archives: Example String

valueOf(all types) JAVA – JAVA 10th Class notes – ICSE JAVA Notes

valueOf(all types) JAVA – JAVA 10th Class notes – ICSE JAVA Notes valueOf (all types) : valueOf (all types) function converts from String to the primitive datatype.   Note : Conversion from String to primitive datatype is only possible when it contains number (digit). If this function is used with Alphabets or Alpha numeric String […]

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 : […]

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

ToLowerCase  in JAVA – JAVA 10th Class notes – ICSE JAVA Notes   toLowerCase( ) : toLowerCase( ) function will convert all the characters of the String to Lower Case. If any character is in Lower Case or it is a Special Character, then it will remain the same. Syntax : String res = var.toLowerCase(); […]

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

ToUpperCase  in JAVA – JAVA 10th Class notes – ICSE JAVA Notes   toUpperCase( ) : toUpperCase( ) function will convert all the characters of the String to Upper Case. If any character is in Upper Case or it is a Special Character, then it will remain the same.   Syntax : String res = […]

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 […]