Created
October 15, 2014 18:27
-
-
Save mike-zarandona/ccc10ee351d54648af2e to your computer and use it in GitHub Desktop.
A tiny bit of logic to strip off any protocol from a URL.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// strip off the protocol | |
url = 'http://twitter.com/mikezarandona'; | |
if ( url.indexOf('://') != -1 ) { | |
url = url.substr( url.indexOf('://') + 3 ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment