|
|
| There's more than one way to do things | |
| PerlMonks |
Answer: How do I compare two strings? |
| ( #21412=categorized answer: print w/ replies, xml ) | Need Help?? |
|
Q&A > strings > How do I compare two strings? contributed by PipTigger
As an addendum to turnstep's fine post:
Another useful test is: ne ... as in:
Just as: == tests equality between two numbers, != tests inequality for numbers and eq tests strings for equality as ne tests strings for inequality. I often find it useful to test to verify that a string has a value even if it's == 0.
|
|
||||||||||||||||||