Skip to content

Instantly share code, notes, and snippets.

@mike-zarandona
Created October 15, 2014 18:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mike-zarandona/ccc10ee351d54648af2e to your computer and use it in GitHub Desktop.
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.
// 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