English

Which of the following functions is used to remove leading and trailing white spaces from the string? - Computer Applications

Advertisements
Advertisements

Question

Which of the following functions is used to remove leading and trailing white spaces from the string? 

Options

  • trim()

  • trail()

  • truncate()

  • slice()

MCQ

Solution

trim()

Explanation:

Many computer languages, including Java, employ the trim() function to eliminate leading and trailing white spaces from strings. It just removes the first and last spaces from the string.

shaalaa.com
  Is there an error in this question or solution?
Chapter 4: String Handling - EXERCISES [Page 286]

APPEARS IN

Avichal Computer Applications [English] Class 10 ICSE
Chapter 4 String Handling
EXERCISES | Q I. 5. | Page 286
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×