Remove empty spaces from string

PHOTO EMBED

Tue Oct 26 2021 09:49:27 GMT+0000 (UTC)

Saved by @JureVidmar #javascript #jquery

var strLeftIn = $('.left-in-stock').attr('data-value');
var newStr = strLeftIn.replace(/\s+/g, '')
content_copyCOPY

It removes empty spaces ( ' ', '\n',...) from string

https://stackoverflow.com/questions/10800355/remove-whitespaces-inside-a-string-in-javascript