Solved

Remove Protocol if at start of string?

Posted on 2016-11-25
3
11 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 17

Expert Comment

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

Author Closing Comment

by:894359
ID: 41902060
Than you!
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

This article shows how to create and access 2-dimensional arrays in JavaScript.  It includes a tutorial in case you are just trying to "get your head wrapped around" the concept and we'll also look at some useful tips for more advanced programmers. …
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
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…

708 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now