WannaLearnASP
New member
- Joined
- Oct 4, 2004
- Messages
- 3
- Programming Experience
- 1-3
Folks
I am new to Vb.net programming, I have this problem Try to help me out.
I have few phone numbers like this
8122121223EXT123
2126743Parents
I am trying to write a program to find the Characters in the given string
and if there is a character then cut that string at that point and give me the previous numbers
ie I have to cut the string at "E" and give the number 8122121223 back
similarly I have to cut the string at "P" and give 2126743 back.
For this I am checking like this:
If Not IsNumeric(PhoneNumber ) then
Dim arr() As Char
arr = PhoneNumber.ToCharArray
Dim c As Char
Dim str As String
'I am checking each character if it is a number or an alphabet
For Each c In arr
If Not Asc(c) < Asc("A") Or Asc(c) > Asc("Z") Then
'How do I cut the remaining number??
End If
Next c
end if
I hope I did not confuse, can you give me solution asap.
Thanks
I am new to Vb.net programming, I have this problem Try to help me out.
I have few phone numbers like this
8122121223EXT123
2126743Parents
I am trying to write a program to find the Characters in the given string
and if there is a character then cut that string at that point and give me the previous numbers
ie I have to cut the string at "E" and give the number 8122121223 back
similarly I have to cut the string at "P" and give 2126743 back.
For this I am checking like this:
If Not IsNumeric(PhoneNumber ) then
Dim arr() As Char
arr = PhoneNumber.ToCharArray
Dim c As Char
Dim str As String
'I am checking each character if it is a number or an alphabet
For Each c In arr
If Not Asc(c) < Asc("A") Or Asc(c) > Asc("Z") Then
'How do I cut the remaining number??
End If
Next c
end if
I hope I did not confuse, can you give me solution asap.
Thanks