Skip to content

Commit

Permalink
Added getFileExtension method.
Browse files Browse the repository at this point in the history
  • Loading branch information
mde committed Jun 7, 2010
1 parent 49c8810 commit 4b2b68b
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/url.js
Expand Up @@ -224,6 +224,15 @@ fleegix.url = new function () {
this.getBase = function (s) {
return s.split(_QS_SIMPLE)[0];
};

this.getFileExtension = function (str) {
var ext = null;
var pathArr = str.split('.');
if (pathArr.length > 1) {
ext = pathArr[pathArr.length - 1];
}
return ext;
};
};
// Backward-compat shim
fleegix.uri = new function () {
Expand Down

0 comments on commit 4b2b68b

Please sign in to comment.