There is a A1_ZTEL
field in the database that is varchar(15)
. This way, each user entered a record of all forms, with bar, dot, comma and letter.
Now I need to mount a form and read this field from another table that is varchar(40)
and save on A1_ZTEL
( varchar 15
).
Before I show in FORM, taking only the first 15 digit and in the format (99)9999-9999?9
(phone or cel). So far so good.
For this, I treat the bank's return, and I do it with Replace()
and Trim()
Example:
p.ZC_CELULAR = reader["A1_ZTEL"].ToString().Trim().Substring(0,15).Replace("-","").Replace(".","").Replace(",","").Replace("/","")
In this way I can only get the number and put it in input
with the mask.
Now I came across letters, how do I replace letters for nothing? Something like: Replace("letras","")