答案 0 :(得分:0)
快速字符串现在有所不同。不再有characters
属性。这应该可以解决问题:
extension URL {
func makeStandardizedLastPathComponent() -> String {
return lastPathComponent.trimmingCharacters(in: .whitespaces)
}
func makeStandardizedFirstCharacterOfLastPathComponent() -> Character? {
return makeStandardizedLastPathComponent().localizedUppercase.first
}
}