search and replace string with other string

i am returning the phone numbers of contact and i want to replace the + in the contact phone numbers with 0 

ex:

phone number is    +12355555

so i want to replace that +12355555 with 055555   ( just replace the +123 with 0 )

is there is any way to do this ?

The function you want to use is:
 
https://docs.coronalabs.com/daily/api/library/string/gsub.html
 
To accomplish your specific end-goals you’ll need to search for examples of “lua gsub substitution”, or hope someone has a ready made example here for you.
 
Besides googling like a mad-man, I often find answers of the beginning of answers here: http://rosettacode.org/wiki/Rosetta_Code
 
For the exact question you asked, I did this (experts at Lua string syntax correct any errors for me if you see them):

local original = "+12355555" local new = string.gsub( original, "%+123", "0") print( original ) print( new )

it works . Thanks roaminggamer for the site .

The function you want to use is:
 
https://docs.coronalabs.com/daily/api/library/string/gsub.html
 
To accomplish your specific end-goals you’ll need to search for examples of “lua gsub substitution”, or hope someone has a ready made example here for you.
 
Besides googling like a mad-man, I often find answers of the beginning of answers here: http://rosettacode.org/wiki/Rosetta_Code
 
For the exact question you asked, I did this (experts at Lua string syntax correct any errors for me if you see them):

local original = "+12355555" local new = string.gsub( original, "%+123", "0") print( original ) print( new )

it works . Thanks roaminggamer for the site .