mirror of
https://github.com/yattee/yattee.git
synced 2024-11-14 10:08:23 +00:00
11 lines
287 B
Swift
11 lines
287 B
Swift
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)
|
|
}
|
|
}
|