Removing repeated string in javascript -


i have problem 1 of string has repeated url inside , want remove it. what's best way in javascript?

following example of string referring to.

var str = "http://www.example.comhttp://www.example.com"

one solution reassign str half of itself.

str = str.substring(str.length/2) 

(this assumes string follow same format example gave.)


Comments

Popular posts from this blog

get url and add instance to a model with prefilled foreign key :django admin -

css - Make div keyboard-scrollable in jQuery Mobile? -

ruby on rails - Seeing duplicate requests handled with Unicorn -