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
Post a Comment