I wonder how to remove commas from given string. My try was:
st = "1,2,3"
String.strip(st, ?,)
#=> "1,2,3"
What am I doing wrong?
String.strip/2
only removes characters at the beginning and end of the string. I believe you're looking for String.replace/4
. Use it like this:
String.replace("1,2,3", ",", "")
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With