# Remove extra whitespace from string

* split_whitespace

* The second solution is obviously the better solution, but the first one might be applied to situations where we would like to get rid of other duplicate characters.

{% embed include file="src/examples/strings/remove-extra-white-spaces/src/main.rs" %}
{% embed include file="src/examples/strings/remove-extra-white-spaces/out.out" %}


