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

SPSS keyboard combination alters encoding -

Add new record to the table by click on the button in Microsoft Access -

javascript - jQuery .height() return 0 when visible but non-0 when hidden -