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…

Java-Get Position

Get Position The indexOf( ) method provides the position of a specific character in the given string. For example, in the following program, the indexOf( ) method will return ‘2‘ as the answer. This method has returned the position of first occurrence of the specified character. There is one more method known as the lastIndexOf( … Read more…