Sep 4, 2002 #1 Esoteric ISP Feb 10, 2001 93 US Is there a quick way to take this (555) 555-1212 and convert it to this 5555551212? Please help - I thought maybe a trim or Replace function might do this, without a function.
Is there a quick way to take this (555) 555-1212 and convert it to this 5555551212? Please help - I thought maybe a trim or Replace function might do this, without a function.
Sep 4, 2002 #2 onpnt Programmer Dec 11, 2001 7,778 US Dim regEx Set regEx = New RegExp regEx.Global = true regEx.Pattern = "[\(\)\-\s]" str = "(333) 333-3333" str = Trim(regEx.Replace(str, "") alert str http://www.onpntwebdesigns.comadmin@onpntwebdesigns.com Upvote 0 Downvote
Dim regEx Set regEx = New RegExp regEx.Global = true regEx.Pattern = "[\(\)\-\s]" str = "(333) 333-3333" str = Trim(regEx.Replace(str, "") alert str http://www.onpntwebdesigns.comadmin@onpntwebdesigns.com
Sep 5, 2002 #3 sfvb Programmer Nov 25, 2001 399 US This also works: str = "(555) 555-1212" str = replace(replace(replace(replace(str,"-", ""," ", "","", "","(", "" Upvote 0 Downvote
This also works: str = "(555) 555-1212" str = replace(replace(replace(replace(str,"-", ""," ", "","", "","(", ""
Sep 5, 2002 #4 onpnt Programmer Dec 11, 2001 7,778 US I think the point of regex is to eleviate lines of code like that. (makes debugging hell!) however it does work well. http://www.onpntwebdesigns.comadmin@onpntwebdesigns.com Upvote 0 Downvote
I think the point of regex is to eleviate lines of code like that. (makes debugging hell!) however it does work well. http://www.onpntwebdesigns.comadmin@onpntwebdesigns.com
Sep 5, 2002 #5 sfvb Programmer Nov 25, 2001 399 US (makes debugging hell!) I agree, but he seemed to want to use either the trim or replace function. Upvote 0 Downvote