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…

Get Specific Index

Java-Get Specific Index

Get Specific Index The String class provides two methods, indexOf( ) and lastIndexOf( ), that allows you to get index of a specified character or starting index of the specified substring. The indexof() method has four forms: The lastIndexOf( ) method has four forms: These all methods return the index at which the character or substring … Read more…