Java-Insert

Insert The insert( ) method is a companion method of the append( ) method. While the append( ) method enables us to add a new string only at the end of an existing string, the insert( ) method helps us to add a new string from any specified position in the existing string. For example, … Read more…

Extracting Character and Concatenation

Java-Extracting Character and Concatenation

Extracting Character The charAt( ) method provides the character at the specified index position. The starting value of the index in the case of a string is zero. For example, in the following example, the character at position 3 in the string “ABCDEFG” is ‘D’. Thus, the str1.charAt(3) method will return the character ‘D’. Example: … Read more…