- Home
·
- String Manipulation
·
- Function IsGuid() is checking a string whether it is a valid Guid or not. Valid formats are: 1) {00
Function IsGuid() is checking a string whether it is a valid Guid or not. Valid formats are: 1) {00
Function IsGuid() is checking a string whether it is a valid Guid or not. Valid formats are: 1) {00000000-0000-0000-0000-000000000000} 2)
Rate Function IsGuid() is checking a string whether it is a valid Guid or not. Valid formats are: 1) {00
(1(1 Vote))
Dim strGuid As String
Dim strMask As String
Dim lngIndex As Long
Dim blnResult As Boolean
blnResult = True
If IsNull(Guid) Then
blnResult = False
Else
strMask = "{[0-9A-F][0-9A-F][0-9A-F][0-9A-F][0-9A-F][0-9A-F][0-9A-F][0-9A-F]" & _
"-[0-9A-F][0-9A-F][0-9A-F][0-9A-F]" & _
"-[0-9A-F][0-9A-F][0-9A-F][0-9A-F]" & _
"-[0-9A-F][0-9A-F][0-9A-F][0-9A-F]" & _
"-[0-9A-F][0-9A-F][0-9A-F][0-9A-F][0-9A-F][0-9A-F][0-9A-F][0-9A-F][0-9A-F][0-9A-F][0-9A-F][0-9A-F]}"
strGuid = CStr(Guid)
If Left(strGuid, 6) = "{guid " And Right(strGuid, 1) = "}" Then
strGuid = Mid(strGuid, 7, Len(strGuid) - 7)
End If
If Not strGuid Like strMask Then
blnResult = False
End If
End If
IsGuid = blnResult
End Function
Function IsGuid() is checking a string whether it is a valid Guid or not. Valid formats are: 1) {00 Comments
No comments yet — be the first to post one!
Post a Comment