A basic String handling question..I have a tokenized String like val1.val2.val3…..valN
How do I get the last word valN from the string above.
A basic String handling question..I have a tokenized String like val1.val2.val3…..valN How do I
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
If you pass a negative index n to the subscript operator in a List, you get n-th last element. Therefore, the -1 element is the last one:
Update: You also have the, arguably more readable,
lastmethod: