get the character at index of string in java
/** * @author lautturi.com * Java example: get the character at the nth position of a string */ import java.util.*; public class Lautturi { public static void main(String[] args) { String str = "hello lautturi"; char ch = str.charAt(6); System.out.println("ch:"+ch); } }Scruoe:www.lautturi.com
output:
ch:l