[JAVA] Display character strings character by character [Note]

Display one character at a time.

demojava/demo8/Demo8.java


package demojava.demo8;

public class Demo8 {
	public static void main(String[] args) {
		
		String s = "TENET";
		for(int i = 0 ; i < s.length();i++){
			System.out.println( (i + 1) + "Letter= " + s.charAt(i));
		}
		for(int i = ( s.length() - 1); i >=0 ;i--){
			System.out.println( (i + 1) + "Letter= " + s.charAt(i));
		}

	}
	
}

2020-10-10_21-19-47.png

Recommended Posts

Display character strings character by character [Note]
Display text character by character in Android Surface View
[Ruby] Repeating arbitrary character strings
Display character strings character by character [Note]
[Rails] How to omit the display of the character string of the link_to method
[Java] Remove whitespace from character strings
[Algorithm] Descending order of character strings