Array/List to String without the [ ] chars

I have an iphone/mobile integration sensor that has locations in list format (latitude and longitude). When I use this value, it became string with [ ] characters.
E.g.

Location:
- 1.123456
- 100.123456

It became [1.123456, 100,123456]

How to format it to only be: 1.123456, 100.123456, i.e without the [ ] chars?

I need it to append to telegram message to create google map link.

https://www.google.com/maps/search/{{ state_attr("sensor.iphone_geocoded_location","Location") }}

It gave: https://www.google.com/maps/search/[1.123456, 100.123456].
I need it to be: https://www.google.com/maps/search/1.123456, 100.123456.

For those seeking solution to similar problem, I found the way.
Text in an array can be extracted by specifying its item position.

Solution:

https://www.google.com/maps/search/{{state_attr("sensor.iphone_geocoded_location","Location")[0]}},{{state_attr("sensor.iphone_geocoded_location","Location")[1]}}

It gives even better result, without the space:

https://www.google.com/maps/search/1.123456,100.123456.
1 Like