mirror of
https://github.com/mas-cli/mas
synced 2024-12-25 11:23:08 +00:00
22 lines
469 B
Swift
22 lines
469 B
Swift
|
//
|
||
|
// String+FileExtension.swift
|
||
|
// MasKitTests
|
||
|
//
|
||
|
// Created by Ben Chatelain on 1/5/19.
|
||
|
// Copyright © 2019 mas-cli. All rights reserved.
|
||
|
//
|
||
|
|
||
|
import Foundation
|
||
|
|
||
|
extension String {
|
||
|
/// Returns the file name before the extension.
|
||
|
var fileNameWithoutExtension: String {
|
||
|
return (self as NSString).deletingPathExtension
|
||
|
}
|
||
|
|
||
|
/// Returns the file extension.
|
||
|
var fileExtension: String {
|
||
|
return (self as NSString).pathExtension
|
||
|
}
|
||
|
}
|