How to access string characters in java?
3 answers
charAt() method
String str = "abc"; System.out.println(str.charAt(0)); - Thanks for the help) - Oleg
|
For this there is a method charAt ( https://docs.oracle.com/javase/8/docs/api/java/lang/String.html#charAt-int- ).
|
The charAt(index) method will help you here, where index is the letter number starting at 0 !!
Here you can also get acquainted with all the main operations on strings.
|