DotNet Academy of Rajesh Rolen

Solutions by Rajesh Rolen

Search string with Wild Card

Public Function CheckWildCardString(ByVal String1 As String, ByVal String2 As String) As BooleanDim I As Long If Left$(String1, 1) = Chr$(42) And Right$(String1, 1) = Chr$(42) ThenString1 = Replace$(String1, Chr(42), Empty) For I = 1 To Len(String2) If LCase$(Mid(String2, I, Len(String1))) = LCase$(String1) ThenCheckWildCard = TrueExit FunctionEnd IfNext IElseIf Left$(String1, 1) = Chr$(42) Then If LCase$(Right(String2, Len(String1))) = LCase$(String1) ThenCheckWildCard = TrueExit FunctionEnd IfElseIf Right$(String1, 1) = Chr$(42) ThenString1 = Replace$(String1, Chr$(42), Empty)If LCase$(Left(String2, Len(String1))) = LCase$(String1) ThenCheckWildCard = TrueExit FunctionEnd IfElseCheckWildCard = FalseExit FunctionEnd IfEnd Function

0 comments:

Post a Comment

About this blog

My Blog List

Advertise On This Site

Site Info

Advertise on this Site

To advertise on this site please mail on RajeshRolen@gmail.com

Information Source

About

Pages

Dot Net Academy

Advertis in This Area of Site

Powered by Blogger.

Followers

Search This Blog