Forum Moderators: open
var Dimensional = '[["0","0"],["1","1"],["2","2"],["3","3"],]';
Then you could get rit of the last comma by using a regular expression
re = /\]\,\]/gi;
var newstr=str.replace(re, ']]');
My question is about the code you posted.
The var newstr = str.replace(re, ']]');
I know I'm supposed to replace the str part with the variable name I'm trying to work with. But everytime I replace it to Dimensional.replace(re, ']]');
It ends up giving me an error.
The error is :
Object doesn't support this property or method.
So I was just wondering if you can explain how to use the code a little more so that I can see if I'm doing something wrong.
Oh, thanks txbakers, but I've been told to do it strictly in JS.
:)