English

Write down the syntax to perform the following task: To extract the last character of a word(wd) stored in the variable chr. - Computer Applications

Advertisements
Advertisements

Question

Write down the syntax to perform the following task:

To extract the last character of a word(wd) stored in the variable chr.

One Line Answer

Solution

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

APPEARS IN

Avichal Computer Applications [English] Class 10 ICSE
Chapter 4 String Handling
EXERCISES | Q III. 3. | Page 287
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×