String charAt()
- 26th Dec 2017
- 0
- 7341
- charAt() method in string How to find the character at specified position in java string importance of charAt() method in java usage of charAt() method in java when to use charAt() ?
Let us understand charAt() method This method returns the character at the specified index and Index starts from 0 Method signature public char charAt(int index) public char charAt(int index) This method throws StringIndexOutOfBoundsException exception When, index is either negative or greater than or equal to the size of the string Example public class CharAtExample1{ […]