mirror of
https://github.com/yattee/yattee.git
synced 2025-10-13 10:58:11 +00:00
iOS 14/macOS Big Sur Support
This commit is contained in:
10
Extensions/String+Format.swift
Normal file
10
Extensions/String+Format.swift
Normal file
@@ -0,0 +1,10 @@
|
||||
import Foundation
|
||||
|
||||
extension String {
|
||||
func replacingFirstOccurrence(of target: String, with replacement: String) -> String {
|
||||
guard let range = range(of: target) else {
|
||||
return self
|
||||
}
|
||||
return replacingCharacters(in: range, with: replacement)
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user