String messageText = "test";
char lastChar = messageText.charAt(messageText.length()-1);
if(lastChar!='e' && lastChar!='s' ){
System.out.print("the last char is different of e and s , it's : "); // the last char is different of e and s , it's :
System.out.println(lastChar); // t
}
Reference:
http://answers.yahoo.com/question/index?qid=20080914170215AAmVQQt
char lastChar = messageText.charAt(messageText.length()-1);
if(lastChar!='e' && lastChar!='s' ){
System.out.print("the last char is different of e and s , it's : "); // the last char is different of e and s , it's :
System.out.println(lastChar); // t
}
Reference:
http://answers.yahoo.com/question/index?qid=20080914170215AAmVQQt
No comments:
Post a Comment