Remove All Blank Spaces from a String

Given a string with tons of whitespaces, our task is to remove them.

For example: 
Input: s = "   h a c k y o  u r c o de  " 
output: "hackyourcode"

There are a lot of ways to remove whitespace from a string. 


Thank you so much for reading this article, if you like this question please share this with your friends who love programming. And if you have questions or feedback please drop a comment.

To solve more problems, please check out this article "Top 10 String Interview Questions".

All the Best!

Comments

Popular posts from this blog

Four Sum Problem (4sum) Solution in Java, Python, C++

Find the length of the longest substring without repeating character

Reverse Words in a Sentence Without using any Library