2019-01-06 19:26:08 +00:00
|
|
|
//
|
|
|
|
// String+FileExtension.swift
|
2024-10-01 18:05:41 +00:00
|
|
|
// masTests
|
2019-01-06 19:26:08 +00:00
|
|
|
//
|
|
|
|
// 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 {
|
2021-03-22 05:46:17 +00:00
|
|
|
(self as NSString).deletingPathExtension
|
2019-01-06 19:26:08 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/// Returns the file extension.
|
|
|
|
var fileExtension: String {
|
2021-03-22 05:46:17 +00:00
|
|
|
(self as NSString).pathExtension
|
2019-01-06 19:26:08 +00:00
|
|
|
}
|
|
|
|
}
|