KAB
2006-02-04 18:04:39 UTC
Hi Sean:
InStr should have worked (I've used it many times). Be sure the strings
have matched cases (upper case/ lower case). Also, note that InStr has four
different comparing methods, so you may wish to state "1" in the function to
force a text comparison.
string1=InStr(1,string1,"DRA-SYMB",1)
or
string1=InStr(3,string1,"DRA-SYMB",1)
To truncate the E- use the "Right String"
or "Mid String". For some reason, I found the "Mid" function to be more
reliable than "Left" or "Right" functions so I recommend it first.
string1=Right(string1,len(string1)-2)
or
string1=Mid(string1,3,len(string1)-2)
I hope this helps:
KAB
InStr should have worked (I've used it many times). Be sure the strings
have matched cases (upper case/ lower case). Also, note that InStr has four
different comparing methods, so you may wish to state "1" in the function to
force a text comparison.
string1=InStr(1,string1,"DRA-SYMB",1)
or
string1=InStr(3,string1,"DRA-SYMB",1)
To truncate the E- use the "Right String"
or "Mid String". For some reason, I found the "Mid" function to be more
reliable than "Left" or "Right" functions so I recommend it first.
string1=Right(string1,len(string1)-2)
or
string1=Mid(string1,3,len(string1)-2)
I hope this helps:
KAB
I have been racking my brain tryign to understand how to compare two string
in vb6. Can someone help?
I have a string E-DRA-SYMB that has to be compared to DRA-SYMB. As long as
string2 is found in string one, I want a return value of true. I tried the
InStr and Like commands but I never get the correct response. What can I do?
How do I truncate the E- from string1 before comparing both strings?
Any help would be greatly appreciated.
Sean Campbell
in vb6. Can someone help?
I have a string E-DRA-SYMB that has to be compared to DRA-SYMB. As long as
string2 is found in string one, I want a return value of true. I tried the
InStr and Like commands but I never get the correct response. What can I do?
How do I truncate the E- from string1 before comparing both strings?
Any help would be greatly appreciated.
Sean Campbell