【发布时间】:2020-07-08 06:06:03
【问题描述】:
我想在字符串 (apellidoPat) 中找到第一个元音,例如,如果我的字符串是“CRUZ”,我的扩展输出是:“U”我可以使用什么?一个循环??
var apellido_paterno = "CRUZ"
let vowels = "AEIOU"
for index in stride(from: 0, to: apellido_paterno.count , by: 1){
if vowels.index(of: ){
}
}
【问题讨论】:
-
你认为“带变音符号的字母”(如 áèïōû)是元音吗?连字(–,æ)怎么样?
-
@Sweeper No only AEIOU
标签: ios swift string xcode character