How to access string characters in java?

  • 3
    Three answers and everything about charAt (), all three gained a reputation for fun, four things to add for freebies? - Aleksei Chibisov
  • one
    @AlekseiChibisov you can try;) - Alex Chermenin

3 answers 3

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.