Which function is used to remove whitespace from the beginning and end of a string?

Explanation:

trim() removes extra whitespace from both ends of a string.

Explore more in Computer Science: