Groovy web console

subscribe to the feed Subscribe
to this
site
Remove character from String (via #groovywebconsole)
tweet this snippet Tweet
this
script

Remove character from String

Published 2 months ago by Mak with tags remove replace string
Actions  ➤ Edit in console Back to console Show/hide line numbers View recent scripts
String phoneNumber = "+100"
println(phoneNumber)
if(phoneNumber.contains("+"))
{
phoneNumber = phoneNumber.replace("+","")
}
println(phoneNumber)