Should work fine

This commit is contained in:
cdricms
2025-12-06 17:28:17 +01:00
parent 401d268aa4
commit c94088c1f0
5 changed files with 312 additions and 67 deletions

View File

@@ -1,12 +0,0 @@
import Foundation
extension String {
public func camelCaseToSnakeCase() -> String {
let pattern = "([a-z0-9])([A-Z])"
let regex = try! NSRegularExpression(pattern: pattern, options: [])
let range = NSRange(location: 0, length: self.count)
return regex.stringByReplacingMatches(
in: self, options: [], range: range, withTemplate: "$1_$2"
).lowercased()
}
}