How I can Get a substring from String using JQuery

How I can Get a substring from String using JQuery

Hi,

           I have the string  'demo1/UploadedImages/Container1/Imagename.jpg'. Now I want to get the string 

'UploadedImages/Container1/'  as a string and 'imagename.jpg'  as string individually. 

How can I achieve this using jquery..

Please give quick reply..

Thanks in advance..