Computer Applications
Write a statement for each to perform the following task on a string:
Extract the second last character of a word stored in the variable wd.
Java String Handling
ICSE 2010
53 Likes
Answer
char ch = wd.charAt(wd.length() - 2);
Answered By
34 Likes
Related Questions
State the purpose and return data type of indexOf() function.
State the purpose and return data type of compareTo() function.
Write a statement for each to perform the following task on a string:
Check if the second character of a string str is in upper case.
Write a statement each to perform the following task on a string:
Find and display the position of the last space in a string s.