How can you get the last character of a string `s`?
Correct answer
s.charAt(s.length() - 1)
Explanation
s.charAt(s.length() - 1) returns the last character of a string.
Update: Admin added a tag on this question
Topics
By Admin · · 21 views