javascript中 获取字符串中最后一个斜杠后面的内容

var str = "http://7xiba5.com2.z0.glb.clouddn.com/07202017-1601-0000-0030-000000000098/20180517150026/file/image/M_20180517150023_0000_T.jpg",index = str .lastIndexOf("\/");  
str  = str .substring(index + 1, str .length);
alert(str );

猜你喜欢

转载自blog.csdn.net/web_cgh/article/details/80549516