Remove empty spaces from string

PHOTO EMBED

Tue Oct 26 2021 09:49:27 GMT+0000 (Coordinated Universal Time)

Saved by @PIzmAR #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