views:

54

answers:

3

What is the opposite of the string comparison

thisString->EndsWith("String")

If it does not end with...

+5  A: 
!thisString->EndsWith("String");
Winston Ewert
+1  A: 

Not exactly sure what you mean by "opposite", but there is a StartsWith method. Alternatively if you're looking for whether it doesn't end with you could just negate the value returned by EndsWith. Hope this helps, and that I'm understanding the question correctly.

cmptrer
A: 

Verbose:

if (thisString->EndsWith("String") == false)
{
    // does not end with
}

Terse:

if (!thisString->EndsWith("String"))
{
    // ditto
}
egrunin