Tag Archives: String Str1

setLength(n)in JAVA – JAVA 10th Class notes – ICSE JAVA Notes

setLength(n)in JAVA – JAVA 10th Class notes – ICSE JAVA Notes setLength(n) : setLength(n) function allows you to set the length of a string buffer variable up to the specified range. If a string to be stored has more than the specified length then the characters exceeding the length are truncated, or otherwise stores NULL […]

setCharAt(index,c )in JAVA – JAVA 10th Class notes – ICSE JAVA Notes

setCharAt(index,c )in JAVA – JAVA 10th Class notes – ICSE JAVA Notes   setCharAt(index,c) : setCharAt(index,c) function can be applied to replace a character with the other character at the specified index.   Syntax : str1.setCharAt(index, character);   Example : StringBuffer str1 = new StringBuffer(“COMMUTER”); str1.insert(3, ‘P’);   Output : COMPUTER   /* Program to […]

insert(offset, x) in JAVA – JAVA 10th Class notes – ICSE JAVA Notes

insert(offset, x) in JAVA – JAVA 10th Class notes – ICSE JAVA Notes insert(offset, x) : insert(offset, x) function allows you to insert a String at the specified index into the another String. Syntax : str1.insert(index, str2); Example : StringBuffer str1 = new StringBuffer(“COMPUTER FUN”); StringBuffer str2 = new StringBuffer(“ IS”); str1.insert(8,str2);   Output : […]

append(x) in JAVA – JAVA 10th Class notes – ICSE JAVA Note

append(x) in JAVA – JAVA 10th Class notes – ICSE JAVA Notes append(x ) : append(x ) function lets you add String x at the end of the other String. Syntax : str1.append(str2); Example : StringBuffer str1 = new StringBuffer(“COMPUTER”); StringBuffer str2 = new StringBuffer(“ APPLICATION”); str1.append(str2);   Output : COMPUTER APPLICATION   /* Program […]

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

Character is equalsIgnore Case (String str) in JAVA – JAVA 10th Class notes – ICSE JAVA Notes

Character is equalsIgnore Case (String str) in JAVA – JAVA 10th Class notes – ICSE JAVA Notes   equalsIgnoreCase(String str) : equalsIgnoreCase(String str) function is used to compare two strings together to check whether they are identical or not, by ignoring the Case. The equalsIgnoreCase() function is NOT Case Sensitive, which means that ‘COMPUTER’ written […]

Character is equals (String str) in JAVA – JAVA 10th Class notes – ICSE JAVA Notes

Character is equals (String str) in JAVA – JAVA 10th Class notes – ICSE JAVA Notes equals(String str) : equals(String str) function is used to compare two strings together to check whether they are identical or not. It returns a Boolean type value. The equals() function is Case Sensitive, which means that ‘COMPUTER’ written in […]

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