<human>:  how to trim whitespace in.
<bot>: Here is a Python function to trim whitespace in the code

import re

def _trim_whitespace(text):
  """ Trim whitespace in text. """
  return re.sub(r'\s+','', text)

# Enter the string
text = "Hello\nWorld\n"

# Calling the function
print((_trim_whitespace(text)))

#Example Output
# HelloWorld

#Remember to inspect code for bugs.