- implement stringByDeletingPathExtension

This commit is contained in:
Emmanuel Maillard authored and Ross Boucher committed 2010-03-27 13:23:32 -07:00
1 parent 1ff873e170
commit 33f56bb203
1 file changed
+9
+9
View File
@@ -699,6 +699,15 @@ var CPStringRegexSpecialCharacters = [
return path;
}
/*!
Deletes the extension of a string.
This method assumes that the string's contents is the path to a file or just a filename.
*/
- (CPString)stringByDeletingPathExtension
{
return substr(0, [self length] - ([self pathExtension].length + 1));
}
- (CPString)stringByStandardizingPath
{
return objj_standardize_path(self);