String messageText = "test";
char lastChar = messageText.charAt(messageText.length()-1);
System.out.println(lastChar); // t
Reference:
http://download.oracle.com/javase/tutorial/java/data/manipstrings.html
char lastChar = messageText.charAt(messageText.length()-1);
System.out.println(lastChar); // t
Reference:
http://download.oracle.com/javase/tutorial/java/data/manipstrings.html
No comments:
Post a Comment