I need to replace strings like '5 hours' with '5h'. But I'm only able to get it to '5 h'. How to remove the space in between? When I replace the "hours" in my function to " hours" with a whitespace, it replaces nothing and returns '5 hours'.
$('div.block_name span').text(function(){
return $(this).text().replace("hours","h");
});