strcomp vs =, <>

  • Thread starter Thread starter Squik27
  • Start date Start date
S

Squik27

Hi,
Just a quick question. If all i want to know is whether or not two strings
read the same, what's the difference between 'if strcomp(st1, st2) <> 0
then...' and 'if st1 <> st2 then... '? Which is faster, more efficient?

Thank you
 
The built-in operator <> will be faster than the function call StrComp().

Use StrComp() only if you want a case-sensitive comparison.

And if the data is coming from tables, remember to handle Nulls as well.
 
Back
Top