regex vs string replace

1.4k Views Asked by At

Actually I've used regex pattern on url to replace its string. I tried to replace the "www." from the url. Now, I would like to know that is there any benefit or problem to use regex pattern instead to put that exact string.

For example, sting.replace("/w{3}./","") vs string.replace("www.","");

I am asking about the topic like execution time.

0

There are 0 best solutions below