I need to create a string like this to make works the mapserver request:

`filterobj = "POLYGON((507343.9 182730.8, 507560.2 182725.19999999998, 507568.60000000003 182541.1, 507307.5 182563.5, 507343.9 182730.8))";`

Where the numbers are map coordinates `x` `y` of a polygon, the problem is with Javascript and OpenLayer what I have back is an array of numbers, How can I remove just the ODD commas (first, third, fifth...)?

At the moment I've created the string in this way:

```
filterobj = "POLYGON((" +  
Dsource.getFeatures()[0].getGeometry().getCoordinates() + " ))";

```

And the result is:

`POLYGON((507343.9, 182730.8,507560.2, 182725.19999999998, 507568.60000000003, 182541.1, 507307.5, 182563.5,507343.9, 182730.8));`

It's almost what I need but, I need to remove the ODD commas from the `Dsource.getFeatures()[0].getGeometry().getCoordinates()` array to make the request work, how can I do that?