How to remove white space from a string?
Good evening, I am trying to find a way to remove white space from a string in JS, but as of right now, I have found no solution.
Here is some example code:
var Array = [];
var foo = "Hello";
var voo = "World";
if (foo != null){
Array.push(foo);
}
if (voo !- null){
Array.push(voo):
}
console.println(Array.join(', ');
\\Results: "Hello , World"\\
\\The space left of the comma should not be there\\
That really is the short of it.
Is there any way to remove spaces from a string, or at least from an Array?
That, or remove the space from the left of the comma?
Thank you!
