System.Linq Any(String.Contains) equivalent

Aug 15, 2011 at 4:32 PM

I would like to do the equivalent of




I have this so far, but doesn't do anything.



Not sure if I am headed in the right direction or not.

What do you think?



Aug 16, 2011 at 5:47 AM

Sorry, I don't understand what you want to say.
Give me a cord working definitely then I can get your intention.
But is it such a thing if I guess?

    .Any(function (x) { return "tabcrget".indexOf(x) != -1 })

JavaScript's String have no Contains.
Therefore instead of Contains, we can use indexOf.

Aug 16, 2011 at 3:31 PM

Thanks, that was exactly what I was looking for.