The method you're looking for is charAt. Here's an example:

String text = "foo";
char charAtZero = text.charAt(0);
System.out.println(charAtZero); // Prints f

For more information, see the Java documentation on String.charAt. If you want another simple tutorial, this one or this one.

If you don't want the result as a char data type, but rather as a string, you would use the Character.toString method:

String text = "foo";
String letter = Character.toString(text.charAt(0));
System.out.println(letter); // Prints f

If you want more information on the Character class and the toString method, I pulled my info from the documentation on Character.toString.

Answer from Ricardo Altamirano on Stack Overflow
🌐
GeeksforGeeks
geeksforgeeks.org › java › strings-in-java
Java Strings - GeeksforGeeks
In Java, a String is the type of object that can store a sequence of characters enclosed by double quotes and every character is stored in 16 bits, i.e., using UTF 16-bit encoding. A string acts the same as an array of characters.
Published   February 12, 2019
🌐
Oracle
docs.oracle.com › javase › 8 › docs › api › java › lang › String.html
String (Java Platform SE 8 )
October 20, 2025 - List<String> strings = new LinkedList<>(); strings.add("Java");strings.add("is"); strings.add("cool"); String message = String.join(" ", strings); //message returned is: "Java is cool" Set<String> strings = new LinkedHashSet<>(); strings.add("Java"); strings.add("is"); strings.add("very"); strings.add("cool"); String message = String.join("-", strings); //message returned is: "Java-is-very-cool" Note that if an individual element is null, then "null" is added. ... delimiter - a sequence of characters that is used to separate each of the elements in the resulting String
🌐
TheServerSide
theserverside.com › blog › Coffee-Talk-Java-News-Stories-and-Opinions › Find-Java-String-Length-Example-Tutorial
How do I find the Java String length?
The need to find the length of a Java String is a common programming requirement. Learn how to get the size of a Java String and avoid lengthy errors developers often encounter.
🌐
W3Schools
w3schools.com › java › java_ref_string.asp
Java String Reference
Java Examples Java Videos Java Compiler Java Exercises Java Quiz Java Code Challenges Java Server Java Syllabus Java Study Plan Java Interview Q&A Java Certificate ... The String class has a set of built-in methods that you can use on strings.
🌐
GeeksforGeeks
geeksforgeeks.org › java › java-program-to-get-a-character-from-a-string
Java Program to Get a Character from a String - GeeksforGeeks
July 29, 2024 - Convert the String into Character array using String.toCharArray() method. Get the specific character at the specific index of the character array. Return the specific character. Below is the implementation of the above approach: ... // Java program to get a specific character // from a given String at a specific index class GFG { // Function to get the specific character public static char getCharFromString(String str, int index) { return str.toCharArray()[index]; } // Driver code public static void main(String[] args) { // Get the String String str = "GeeksForGeeks"; // Get the index int index = 5; // Get the specific character char ch = getCharFromString(str, index); System.out.println("Character from " + str + " at index " + index + " is " + ch); } }
🌐
W3Schools
w3schools.com › java › java_strings.asp
Java Strings
Java Examples Java Videos Java Compiler Java Exercises Java Quiz Java Code Challenges Java Server Java Syllabus Java Study Plan Java Interview Q&A Java Certificate ... Strings are used for storing text.
Find elsewhere
🌐
TutorialsPoint
tutorialspoint.com › home › java/util › java resourcebundle getstring method
Java ResourceBundle getString Method
September 1, 2008 - The Java ResourceBundle getString(String key) method gets a string for the given key from this resource bundle or one of its parents.
🌐
Oracle
docs.oracle.com › javase › tutorial › java › data › manipstrings.html
Manipulating Characters in a String (The Java™ Tutorials > Learning the Java Language > Numbers and Strings)
The String class has a number of methods for examining the contents of strings, finding characters or substrings within a string, changing case, and other tasks. You can get the character at a particular index within a string by invoking the charAt() accessor method.
🌐
Oracle
docs.oracle.com › javase › 7 › docs › api › java › lang › String.html
String (Java Platform SE 7 )
The class String includes methods for examining individual characters of the sequence, for comparing strings, for searching strings, for extracting substrings, and for creating a copy of a string with all characters translated to uppercase or to lowercase. Case mapping is based on the Unicode Standard version specified by the Character class. The Java language provides special support for the string concatenation operator ( + ), and for conversion of other objects to strings.
🌐
BeginnersBook
beginnersbook.com › 2013 › 12 › java-string-substring-method-example
Java String substring() Method with examples
The substring() method is used to get a substring from a given string. This is a built-in method of string class, it returns the substring based on the index values passed to this method. For example: “Beginnersbook”.substring(9) would return “book” as a substring.
🌐
DataFlair
data-flair.training › blogs › how-to-take-string-input-in-java
How to Take String Input in Java? - DataFlair
April 29, 2022 - The String input is: . FullStop!!! The Scanner class also known as the utility scanner is the more widely used class for taking user input. It is part of the java.util package.
🌐
Vultr Docs
docs.vultr.com › java › standard-library › java › lang › String › charAt
Java String charAt() - Get Character At Index | Vultr Docs
November 19, 2024 - The charAt() method in Java is a straightforward yet essential function of the String class, used to retrieve a character at a specific index from a given string.
🌐
Oracle
docs.oracle.com › en › java › javase › 11 › docs › api › java.base › java › lang › String.html
String (Java SE 11 & JDK 11 )
January 20, 2026 - List<String> strings = List.of("Java", "is", "cool"); String message = String.join(" ", strings); //message returned is: "Java is cool" Set<String> strings = new LinkedHashSet<>(List.of("Java", "is", "very", "cool")); String message = String.join("-", strings); //message returned is: "Java-is-very-cool" Note that if an individual element is null, then "null" is added. ... delimiter - a sequence of characters that is used to separate each of the elements in the resulting String
🌐
Programiz
programiz.com › java-programming › string
Java String (With Examples)
Since strings are represented by double quotes, the compiler will treat "This is the " as the string. Hence, the above code will cause an error. To solve this issue, we use the escape character \ in Java.
🌐
W3Schools
w3schools.com › java › ref_string_indexof.asp
Java String indexOf() Method
Java Wrapper Classes Java Generics Java Annotations Java RegEx Java Threads Java Lambda Java Advanced Sorting ... How Tos Add Two Numbers Swap Two Variables Even or Odd Number Reverse a Number Positive or Negative Square Root Area of Rectangle Celsius to Fahrenheit Sum of Digits Check Armstrong Num Random Number Count Words Count Vowels in a String Remove Vowels Count Digits in a String Reverse a String Palindrome Check Check Anagram Convert String to Array Remove Whitespace Count Character Frequency Sum of Array Elements Find Array Average Sort an Array Find Smallest Element Find Largest Element Second Largest Array Min and Max Array Merge Two Arrays Remove Duplicates Find Duplicates Shuffle an Array Factorial of a Number Fibonacci Sequence Find GCD Check Prime Number ArrayList Loop HashMap Loop Loop Through an Enum