944,093 Members | Top Members by Rank

Ad:
Feb 5th, 2007
0

Compare String with Strings

Expand Post »
Hello Expertz

I am using following function to compare two string.But i want to compare String with strings list like:
str1="A"
str2="A,B,C,D"

vb Syntax (Toggle Plain Text)
  1. Public Function CompareString(ByVal str1 As String, ByVal str2 As String) As Boolean
  2. Dim i As Integer = 0
  3. For i = 0 To str2.Length - str1.Length
  4. If str2.Substring(i, str1.Length) = str1 Then
  5. Return True
  6. End If
  7. Next i
  8. Return False
  9. End Function
  10.  
  11. Function Calling//
  12. If CompareString(Session("directoratename"), direcgrp) = True Then
  13. flag = 1
  14. Response.Redirect("Client_Menu.aspx?id=" & linkid & "&flag=" & Common.encrypt(flag))
  15. Else
  16. flag = 0
  17. Response.Redirect("Client_Menu.aspx?id=" & linkid & "&flag=" & Common.encrypt(flag))
  18. End If

Please let me how to do this using function.......

Many Thanks
Regards
Raman
Last edited by WaltP; Feb 5th, 2007 at 4:18 pm. Reason: Use Code Tags!
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
raman is offline Offline
1 posts
since Jun 2006

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Visual Basic 4 / 5 / 6 Forum Timeline: storing a calendar in VB to Oracle
Next Thread in Visual Basic 4 / 5 / 6 Forum Timeline: Need Help





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC