Here is my string value:
var _str = "please visit http://www.sample.com for more infomation"
I have to display the underlined URL part alone like:
TIA
Here is my string value:
var _str = "please visit http://www.sample.com for more infomation"
I have to display the underlined URL part alone like:
TIA
Use regular expression. Check below pattern, I hope this will work for you.
var str = "please visit http://www.sample.com for more infomation"
var result= str.match(/\bhttps?:\/\/\S+/gi);