Java charAt

Java charAt

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);
	}

}
S‮cruo‬e:www.lautturi.com

output:

ch:l
Created Time:2017-09-02 20:18:50  Author:lautturi