function extractFileExt(fullPathFileName) {
var lastString = fileName.split(/(\\|\/)/g).pop();
var sameLast = lastString.lastIndexOf(".");
if (sameLast < 1)
return "";
return lastString.substr(sameLast+1, lastString.length-sameLast-1);
}
function extractFileName(fullPathFileName) {
if (extractFileExt( fullPathFileName ) == '')
return '';
return fileName.split(/(\\|\/)/g).pop();
}
function extractFileDir(fullPathFileName) {
var name = q5.bcl.Utility.extractFileName(fileName);
return fileName.substr(0, fileName.length - name.length);
}
'Dev > JavaScript' 카테고리의 다른 글
[Nestjs] transform.interceptor 를 Global로 사용시. (0) | 2023.01.06 |
---|---|
[Nestjs] 개발 시작 전 알아두어야 할 것? (0) | 2023.01.03 |
requestAnimationFrame 가 호출이 안될때가 있다. (0) | 2017.01.17 |
closure (클로저)가 무엇인가. (0) | 2015.03.03 |
Memory leak patterns in JavaScript (0) | 2012.08.20 |
Google Chart Tools, 빠르고 다이나믹한 차트 생성 (0) | 2012.07.15 |
HTML5 API 강좌 #3 – 아이폰 Web App 만들기 (0) | 2012.04.23 |
HTML5 API 강좌 #2 – Web SQL Database 와 GeoLocation (0) | 2012.04.23 |