We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a146f83 commit f4ec3d6Copy full SHA for f4ec3d6
Sources/SwiftOCA/OCC/ControlDataTypes/SearchDataTypes.swift
@@ -37,13 +37,13 @@ package extension OcaStringComparisonType {
37
case .substring:
38
lhs.hasPrefix(rhs)
39
case .contains:
40
- lhs.contains(rhs)
+ lhs.indices.contains { lhs[$0...].hasPrefix(rhs) }
41
case .exactCaseInsensitive:
42
lhs.lowercased() == rhs.lowercased()
43
case .substringCaseInsensitive:
44
lhs.lowercased().hasPrefix(rhs.lowercased())
45
case .containsCaseInsensitive:
46
- lhs.lowercased().contains(rhs.lowercased())
+ lhs.lowercased().indices.contains { lhs.lowercased()[$0...].hasPrefix(rhs.lowercased()) }
47
}
48
49
0 commit comments