English

Write a statement to perform the following task on a string: Extract the second last character of a word stored in the variable wd. - Computer Applications

Advertisements
Advertisements

Question

Write a statement to perform the following task on a string:

Extract the second last character of a word stored in the variable wd.

Code Writing

Solution

wd = word.charAt(word.length() − 2);
shaalaa.com
  Is there an error in this question or solution?
Chapter 4: String Handling - EXERCISES [Page 289]

APPEARS IN

Avichal Computer Applications [English] Class 10 ICSE
Chapter 4 String Handling
EXERCISES | Q VII. 3. (i) | Page 289
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×