Skip to content

Commit b2e7f7a

Browse files
authored
Merge pull request #20 from luoxiu/use-isUppercase
use `isUppercase` to check if the character is uppercase
2 parents a6d089d + c1ff160 commit b2e7f7a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

KakaJSON/Extension/String+KJ.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public extension KJ where Base: ExpressibleByStringLiteral {
4242
guard let str = base as? String else { return "" }
4343
var newStr = ""
4444
for c in str {
45-
if ("A"..."Z").contains(c) {
45+
if c.isUppercase {
4646
newStr += "_"
4747
newStr += c.lowercased()
4848
} else {

0 commit comments

Comments
 (0)