Forum Moderators: open
Just wondering if anyone knew how to remove sections of a character string using Javascript.
For example, I have three URLs that I enter into a text box and I want to remove everything after the / by pressing submit.
So this;
www.widgets.com/about.html
www.redwidgets.com/
www.bluewidgets.com/faq.html
Would become;
www.widgets.com
www.redwidgets.com
www.bluewidgets.com
Any help would be much appreciated.
Stefan
var newString = inputString.substring (0, inputString.indexOf ('/'));