Computer Applications
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.
Java String Handling
ICSE 2011
40 Likes
Answer
System.out.println(s.lastIndexOf(' '));
Answered By
27 Likes
Related Questions
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.
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:
Convert a number stored in a string variable x to double data type.
How does endsWith() and startsWith() differ? Explain with an example.