Menu
I’ve got a javascript that goes like this:
[code=php]function removeSpaces(string) {
var tstring = “”;
string = ” + string;
splitstring = string.split(” “);
for(i = 0; i < splitstring.length; i++)
tstring += splitstring[i];
return tstring;
}
And to tell the truth, I didn’t write this. I just google searched for “Javascript remove spaces”…
But anyway, if I have text like this:
[quote]
1a8f1we6zs94a : ad48
af81ea8af1ge7s : a48a
….etc.
How can I get this, or a similar Javascript to remove the : and everything else up until the point of a line break?
So, that it turns that into
1a8f1we6zs94a
af81ea8af1ge7s