SoyEli Active Member Licensed User Longtime User Sep 18, 2012 #1 Hello: Can someone convert this to b4 for android? VB6= "If Text.text Like "(###) ###-####" Then ..." Thank you
Hello: Can someone convert this to b4 for android? VB6= "If Text.text Like "(###) ###-####" Then ..." Thank you
S ScarBelly Member Licensed User Longtime User Sep 18, 2012 #2 You should use a regular expression rather than such an old method. Do a search and you will find plenty of information. Upvote 0
You should use a regular expression rather than such an old method. Do a search and you will find plenty of information.
SoyEli Active Member Licensed User Longtime User Sep 18, 2012 #3 regular expression ? Can you explain? is vb6 that old ? Thank you: Upvote 0
imbault Well-Known Member Licensed User Longtime User Sep 18, 2012 #4 VB6 is 14 years old... pretty old, now Upvote 0
SoyEli Active Member Licensed User Longtime User Sep 18, 2012 #5 : If Text.text Like "(###) ###-####" Then... So what regular expression should I use ? and can it be converted ? Thank you: Upvote 0
: If Text.text Like "(###) ###-####" Then... So what regular expression should I use ? and can it be converted ? Thank you:
Erel B4X founder Staff member Licensed User Longtime User Sep 19, 2012 #6 Here: B4X: Log(CheckPhoneNumber("(123) 456-7890")) Sub CheckPhoneNumber(s As String) As Boolean Return Regex.IsMatch("\(\d\d\d\)\s\d\d\d-\d\d\d\d", s) End Sub Upvote 0
Here: B4X: Log(CheckPhoneNumber("(123) 456-7890")) Sub CheckPhoneNumber(s As String) As Boolean Return Regex.IsMatch("\(\d\d\d\)\s\d\d\d-\d\d\d\d", s) End Sub