Skip to content

Commit

Permalink
Make parameters removing special characters
Browse files Browse the repository at this point in the history
  • Loading branch information
Wayne Wanbok Choi committed Jul 21, 2022
1 parent 2140ed0 commit 6a51ace
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Sources/POEditorParser/Lib/LiteralsParser.swift
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,10 @@ struct Variable {
- alreadyReadPages <- this should not be captialized (or we'll lose the Read and Pages capital letters)
*/

let words = rawKey.split(separator: " ").map(String.init)
let words = rawKey
.components(separatedBy: .alphanumerics.inverted)
.flatMap { $0.split(separator: " ") }
.map(String.init)
if words.count == 1 {
return words[0].lowercaseFirst
}
Expand Down

0 comments on commit 6a51ace

Please sign in to comment.