I have the following:
        xx = toString( '-' + toString( x ) + '-' );
        z = i.replace( /\-1\-/gi, '-3-' );
This does the replacement as stated, but if I do this:
        xx = toString( '-' + toString( x ) + '-' );
        z = i.replace( /\-1\-/gi, xx );
the replacement is "unknown object" I need the later implementation to work since the replacement will vary. How?
 
    