extracting all non letters from a name

powerade
07-19-2001, 04:41 PM
Hi, I have two list of names and need to compare them to each other but need to take out all the periods and commas in them first. How would I do this without turning all the names into an array of letters and then comparing then. Any suggestions would be great. thanks a lot!

KesleyK
07-20-2001, 09:05 AM
Set up a loop and a temp string:
<pre>
Dim TempString As String
Dim x As Integer

For x = 1 to Len(PassedString)

If Asc(Ucase(Mid(PassedString, x, 1))) > 64 And Asc(Ucase(Mid(PassedString, x, 1))) < 91 Then
TempString = TempString & Mid(PassedString, x, 1)
End If

Next

PassedString = TempString

______
Cheers!<P ID="edit"><FONT class="small"><EM>Edited by KesleyK on 07/20/01 10:29 AM.</EM></FONT></P>

Thinker
07-20-2001, 09:09 AM
One tiny mod,
<pre>
If Asc(Ucase(Mid(PassedString, x, 1))) &gt; 64 And Asc(Ucase(Mid(PassedString, x, 1))) &lt; 91 Then
</pre>

KesleyK
07-20-2001, 09:29 AM
oops!

______
Cheers!

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum