Search code examples
javaphpopenlayers

String variable to Array in java


map.addLayer(
    new OpenLayers.Layer.Vector(layer_id,{
    strategies: [new OpenLayers.Strategy.BBOX()],
    protocol: new OpenLayers.Protocol.HTTP({
        url: 'ajax.jsp?action=getPoi',
        format: new OpenLayers.Format.Text()
        }),

    projection: map.displayProjection,) 
    displayInLayerSwitcher:false
    }); 

in the above code i get a request variable such as

bbox=-0.12856930694582,51.499827348159,-0.1114031692505,51.510512307879

and i need to put the value in bbox to an array in java how is it possible i saw an example in php such as

$bbox_vars = explode(",", $bbox); 

Solution

  • Use split in java

    String[] bboxvar=bbox.split(",");