| | |
Compare String with Strings
![]() |
•
•
Join Date: Jun 2006
Posts: 1
Reputation:
Solved Threads: 0
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"
Please let me how to do this using function.......
Many Thanks
Regards
Raman
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)
Public Function CompareString(ByVal str1 As String, ByVal str2 As String) As Boolean Dim i As Integer = 0 For i = 0 To str2.Length - str1.Length If str2.Substring(i, str1.Length) = str1 Then Return True End If Next i Return False End Function Function Calling// If CompareString(Session("directoratename"), direcgrp) = True Then flag = 1 Response.Redirect("Client_Menu.aspx?id=" & linkid & "&flag=" & Common.encrypt(flag)) Else flag = 0 Response.Redirect("Client_Menu.aspx?id=" & linkid & "&flag=" & Common.encrypt(flag)) 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
- How to compare string value (Java)
- how to compare a string to null... (C++)
- hi.. string compare (Java)
- Determine if a certain ivalue is in a string (C++)
- Is there a way to tokenize an array of strings (C++)
- Question about comparing a string with a character (C++)
- need info? can't use strcmp/string compare (C++)
Other Threads in the Visual Basic 4 / 5 / 6 Forum
- Previous Thread: storing a calendar in VB to Oracle
- Next Thread: Need Help
| Thread Tools | Search this Thread |
* 6 429 2007 access activex add age application basic beginner birth bmp calculator cd cells.find click client code college component connection connectionproblemusingvb6usingoledb copy creat ctrl+f data database datareport date delete dissertations dissertationthesis dissertationtopic edit error excel excelmacro file filename form hardware header iamthwee image inboxinvb internetfiledownload keypress label listbox listview liveperson login looping machine microsoft movingranges number objectinsert open oracle password prime program prompt range-objects readfile reading record refresh remotesqlserverdatabase report save search sendbyte sites sort sql sql2008 sqlserver subroutine tags textbox time urldownloadtofile vb vb6 vb6.0 vba visual visualbasic visualbasic6 web window windows





