in reply to Style question: regex versus string builtin function
While I don't doubt that index is faster, I like your first solution better, simply because it's more Perl-ish. You're seeing if a particular delimiter appears on a line.
The alternative would (for me) require I look up how index works -- it's a logical function to have in a language, I just don't think I've ever used it, so I'm not sure what the parameters are or what it returns.
That's just my preference.
|
|---|