Question: I'm working with places, and I need to get the latitude and longitude of my location. I successfully got it like this

```
mLatLang  = placeLikelihood.getPlace().getLatLng();

```

where mLatLang is `LatLng mLatLang;` 

Now, the output of this line is

```
(-31.54254542,62.56524)

```

but since I'm using an URL to query results by the latitude and longitude, I can't put that data inside the query with the parenthesis `()`.

So far I have searched Stack Overflow for all kinds of Regex to remove this, but it seems I can't do it. I have tried this with no success:

```
types = placeLikelihood.getPlace().getPlaceTypes();
mLatLang  = placeLikelihood.getPlace().getLatLng();
String latlongshrink = mLatLang.toString();
latlongshrink.replaceAll("[\\\\[\\\\](){}]","");

```

I have also tried a lot more `replaceAll` Regex, but I can't remove them.

My output should be like this:

```
-31.54254542,62.56524

```

Answer: 
What you are missing in your logic is that `replaceAll` returns the resultant string. But you are not storing the result, and that's why it's not working. So try as following:

```
latlongshrink = latlongshrink.replaceAll("[\\\\[\\\\](){}]","");

```

Now try to print the result. It'll give the expected result. See [this](https://www.javatpoint.com/java-string-replaceall) for more information about `replaceAll()` function.
If you have a String like "(abc)" and you want to get the content of parenthesis, maybe you can use substring to cut out first and last character.

Something likes that may work in your case (and you do not have to deal with regexp):

```
String withParenthesis = "(abc)";
String content = withParenthesis.substring(1, withParenthesis.length()-1);
System.out.println(content); // print abc

```