English

Describe the purpose of the following function with its syntax: trim() - Computer Applications

Advertisements
Advertisements

Question

Describe the purpose of the following function with its syntax:

trim()

Code Writing

Solution

This function eliminates the string's leading and trailing blank spaces. The other blank spaces between the words do not change.

Example: 

Strings = " Comp class";
s = s.trim();

Output: Comp class

(without the leading and trailing spaces) 

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 VIII. 2. | Page 289
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×