Get values from string using jquery or javascript -


i have string this:-

var src=url("http://localhost:200/assets/images/eyecatcher/6/black6.png)"

and want image name i.e black6.png , folder name 6. know there substr function can use file name , folder name dynamic orange12.png , 12 etc.

how can these values? please me.

thanks

if base url same do

var url = "http://localhost:200/assets/images/eyecatcher/6/black6.png"; var bits = url.replace("http://localhost:200/assets/images/eyecatcher/", "").split("/"); var folder = bits[0], // 6     file = bits[1];  // black6.png 

Comments

Popular posts from this blog

java - How to specify maven bin in eclipse maven plugin? -

Error while updating a record in APEX screen -

c++ - In an add-in in Excel, written in C(++), how does one get the name of the function which called into the addin? -