I have the following strings
http://example.com https://example.com http://www.example.com
how do i get rid of the http:// or
http://
Assuming there are no double slashes other than the protocol, you could do:
var url = "https://example.com"; var noProtocol = url.split('//')[1];