Last active
February 24, 2020 20:18
-
-
Save aoenth/56cae8e5e4e68007faa6bbe8b5529af8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
guard let hyphen = chineseDate.firstIndex(of: "-") else { | |
fatalError("\(chineseDate) is not correctly formatted, use DateFormatter.Style.full") | |
} | |
let startIndex = chineseDate.index(after: hyphen) | |
let endIndex = chineseDate.index(chineseDate.endIndex, offsetBy: -2) | |
let branch = chineseDate[startIndex ... endIndex] | |
print(branch) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment