Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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 ?

like image 563
AndrewS Avatar asked May 21 '13 15:05

AndrewS


Video Answer


1 Answers

Use an instance of URI and use it to split however you want:

URI uri = new URI(whateverYourAddressStringIs); String path = uri.getPath(); // split whatever you need 

http://developer.android.com/reference/android/net/Uri.html

like image 62
Simon Avatar answered Oct 09 '22 02:10

Simon