Open In App

Java Program to get a character from a String

Given a String str, the task is to get a specific character from that String at a specific index.

Examples:



Input: str = "Geeks", index = 2
Output: e

Input: str = "GeeksForGeeks", index = 5
Output: F

Below are various ways to do so:


Article Tags :