Computer Applications
Write down the syntax to extract the last character of a word(wd) stored in the variable chr.
Java String Handling
ICSE 2010
74 Likes
Answer
char chr = wd.charAt(wd.length() - 1);
Answered By
45 Likes
Related Questions
Write down the syntax to check whether a character(chr) is in upper case or not.
Write down the syntax to compare two Strings(str1, str2) are same or not.
Write down the syntax to return the first occurrence of 'a' in the word "applications".
Write down the syntax to replace the word "old" with the word "new" in a given String st = "old is always old"