Sometimes we require to remove white space from given string. So at that time you can delete spaces from string using replace() of core php. replace() will help to replace your blank space or empty space or extra space or trailing space from string that way we can remove. you can do it from bellow example.
<title>Jquery - Remove white space from string</title>
This is my site.
var myText = $(".mytext").text();
var newMyText = myText.replace(/ /g,'');