Sure which part are you stuck on?
iamthwee
Posting Expert
5,950 posts since Aug 2005
Reputation Points: 1,543
Solved Threads: 439
Are you sure your compare method is correct?
For example if both strings are identical is the value equal to 1, like you have put or is it equal to 0.
I think it is equal to 0.
Comparing Strings
The Compare method compares two strings and returns an integer value. The return value of Compare method can be less than zero, greater than zero or equals to zero.
Value Meaning
Less than zero When first string is less than second.
Zero When both strings are equal.
Greater than zero When first string is greater than zero.
iamthwee
Posting Expert
5,950 posts since Aug 2005
Reputation Points: 1,543
Solved Threads: 439
I honestly can't see how you don't understand this?
Dim var As String = "www.google.com"
Dim test As String = "www.google.com"
If test = var Then
MsgBox("match")
End If
Else
MsgBox("wrong")
iamthwee
Posting Expert
5,950 posts since Aug 2005
Reputation Points: 1,543
Solved Threads: 439
Dim var As String = "www.google.com"
Dim test As String = "www.google.com"
If test = var Then
MsgBox("match")
End If
Else
MsgBox("wrong")
Hi Thanx for ure code...but this not the code that im sayin abt....act i dunnoe to compare a string within a string eg:From:"BOB" and Received:"Lisa" have to compare that both from a chunk of email headers from the microsoft outlook..coz im doin a application tool to detect for spoofed email..so i have to compare the 2 field from:"" & received:"" field....if "BOB" and "LISA" r the same den its genuine email else its spoofed....its like compare string within string...i hope u get wad i mean here...thank u very much....it will b a great help if u can help me on dis....
You say you don't know how to compare a string within a string.
You need to google 'searching for substrings within a string'. I know vb.net has a method for this.
iamthwee
Posting Expert
5,950 posts since Aug 2005
Reputation Points: 1,543
Solved Threads: 439