AndrewS AndrewS - 5 months ago 14
Java Question

Remove URL Prefix from String (http:/, www, etc.)

I need to remove all kinds of "web beginnings" from my String

My TextView must be without "http://" , "http:// www." , "www." and other URL prefixes.

Please can you help me to to this ?

Answer

You can do that by using regular expression

"www.aaa".replaceFirst("^(http://www\\.|http://|www\\.)","")
Comments