Given a string A
, how can I determine if that string contains the substring "video/x-flv"
?
views:
191answers:
3Please don't jam your operators together with your operands without whitespace like this. `A.indexOf("video/x-flv") >= 0` is significantly more readable (and fits the style guidelines).
Cory Petosky
2010-04-29 00:17:25
OK. So used to the IDE doing for me that I've become lazy ;)
spender
2010-04-29 00:34:15
A:
http://www.gskinner.com/blog/archives/2007/04/free_extension.html
gSkinner hasText() function
EDIT:
NO Sorry - contains()
Glycerine
2010-04-29 00:04:10
That's quite incorrect. It might still work sometimes, but who'd want something that works only sometimes?
bug-a-lot
2010-04-29 14:14:31
the only thing I see wrong with it is that I forgot the `>=` and just did a `>`. What else is wrong about it? Would be much more effective criticism if you explained why you think it's wrong rather than just claiming that it is. Thanks
invertedSpear
2010-04-29 15:30:55