whychdw
2022-01-18 addddf3e26910b998b61d47826598d15d2314ce7
1
2
3
4
5
6
7
8
9
10
function getFileName(path) {
  let pos1 = path.lastIndexOf('/');
  let pos2 = path.lastIndexOf('\\');
  let pos  = Math.max(pos1, pos2)
  if( pos<0 )
    return path;
  else
    return path.substring(pos+1);
}
export default getFileName;