Comment

Comment by austincheney

Isn't this the very kind of thing Regular Expressions were created to solve?

* Remove spaces - myString.replace(/\u0020+/g, "");

* Remove common line terminators - myString.replace(/(\r|\n)+/g, "");

* Remove all white space - myString.replace(/\s+/g, "");

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton