c# - What's faster: Regex or string operations? -


when should use regex on string operations , vice versa regarding performance?

it depends

although string manipulation faster, actual performance heavily depends on number of factors, including:

  • how many times parse regex
  • how cleverly write string code
  • whether regex precompiled

as regex gets more complicated, take more effort , complexity write equivlent string manipulation code performs well.


Comments

Popular posts from this blog

c# - Farseer ContactListener is not working -

Automatically create pages in phpfox -

database - one php page with different contents and urls -