Given a string with words and multiple white spaces around them, how would you trim it with only 1 white space between the words? For ex: input str = ” Hello world ” output = “Hello world”.
Submit your answers in the comments and receive feedback.
Given a string with words and multiple white spaces around them, how would you trim it with only 1 white space between the words? For ex: input str = ” Hello world ” output = “Hello world”.
Submit your answers in the comments and receive feedback.