Retours sur la structure du code
Some checks failed
gitea-openium/resgen.swift/pipeline/head There was a failure building this commit
Some checks failed
gitea-openium/resgen.swift/pipeline/head There was a failure building this commit
This commit is contained in:
@ -63,7 +63,7 @@ public extension String {
|
||||
replacingOccurrences(of: "~", with: "\(FileManager.default.homeDirectoryForCurrentUser.relativePath)")
|
||||
}
|
||||
|
||||
func colorComponent() -> (alpha: String, red: String, green: String, blue: String) {
|
||||
func colorComponent() -> (alpha: String, red: String, green: String, blue: String) {
|
||||
var alpha: String = "FF"
|
||||
var red: String
|
||||
var green: String
|
||||
@ -89,4 +89,19 @@ public extension String {
|
||||
func uppercasedFirst() -> String {
|
||||
prefix(1).uppercased() + dropFirst()
|
||||
}
|
||||
|
||||
func replacingFirstOccurrence(of: String, with: String) -> Self {
|
||||
if let range = self.range(of: of) {
|
||||
let tmp = self.replacingOccurrences(
|
||||
of: of,
|
||||
with: with,
|
||||
options: .literal,
|
||||
range: range
|
||||
)
|
||||
|
||||
return tmp
|
||||
}
|
||||
|
||||
return self
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user