User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the Visual Basic 4 / 5 / 6 section within the Software Development category of DaniWeb, a massive community of 427,769 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,724 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Visual Basic 4 / 5 / 6 advertiser: Programming Forums
Views: 2458 | Replies: 0
Reply
Join Date: Jun 2006
Posts: 1
Reputation: raman is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
raman raman is offline Offline
Newbie Poster

Compare String with Strings

  #1  
Feb 5th, 2007
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"

  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
  19.  


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

Many Thanks
Regards
Raman
Last edited by WaltP : Feb 5th, 2007 at 3:18 pm. Reason: Use Code Tags!
AddThis Social Bookmark Button
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb Visual Basic 4 / 5 / 6 Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the Visual Basic 4 / 5 / 6 Forum

All times are GMT -4. The time now is 1:17 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC