detecting chars in strings....

Rookie
09-03-2003, 02:29 AM
is there a short way to check a string for characters. Ie. I want to know if a string contains letters or wether it contains numbers.

SpaceFrog
09-03-2003, 02:39 AM
isnumeric(Mystring)

PeterBij
09-03-2003, 03:28 AM
is there a short way to check a string for characters. Ie. I want to know if a string contains letters or wether it contains numbers.


Maybe this code wil help:
any invalid character for filenames are changed with a space

For i = 1 To Len(strTempDocName)
k = Asc(Mid(strTempDocName, i, 1))
If Not (k = 45 Or _
k = 46 Or _
k = 95 Or _
(k >= 48 And k <= 57) Or _
(k >= 65 And k <= 90) Or _
(k >= 97 And k <= 127)) Then
strTempDocName = Mid(strTempDocName, 1, i - 1) & " " & Mid(strTempDocName, i + 1)
End If
next

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum