title: Remove and change a character on string
body: <p>I have an array of strings. What I want is to remove from a string the character &quot;,&quot; and the character &quot;]&quot; change it to &quot;|&quot;.</p>
  <p>string = 3.1321309062246026, 42.02829431948331],</p>
  <p>and i want to get :
  string = 3.1321309062246026, 42.02829431948331|</p>
  <p>so i want to remove final &quot;,&quot; but not the one in the middle. Also to change that ] to | . it has to change like this
  3.1321309062246026,42.02829431948331|</p>