Solved

Remove Protocol if at start of string?

Posted on 2016-11-25
3
32 Views
Last Modified: 2016-11-25
0
Comment
Question by:894359
3 Comments
 
LVL 82

Accepted Solution

by:
leakim971 earned 500 total points
ID: 41902056
var removeHTTPProtocol = function(url) {
    return url.replace(/^https?:/,"")
}

Open in new window

0
 
LVL 28

Expert Comment

by:Pawan Kumar
ID: 41902058
var strRemoveProtocol = (YourString.Replace("https","")).Replace("http","")
0
 

Author Closing Comment

by:894359
ID: 41902060
Than you!
0

Featured Post

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Having worked on larger scale sites, we found out that you are bound to look at more scalable solutions to integrating widgets, code snippets or complete applications and mesh them into functional sites, in any given composition. To share some of…
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

786 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question