Tag Archives: Java-Strings

Searching characters and substring in a String in Java

Searching a character in the String indexOf(char c) : It searches the index of specified character within a given string. It starts searching from beginning to the end of the string (from left to right) and returns the corresponding index if found otherwise returns -1. Note: If given string contains multiple occurrence of specified character… Read More »