草庐IT

replacingOccurrences

全部标签

swift - replacingOccurrences 出现字符串错误

对于以下Swift3代码:varpassword="Maryhadalittlelamp"varnewPassword=password.replacingOccurrences(of:"a",with:"A")我在调用replacingOccurrences时遇到此错误:valueoftype'String'hasnomember'replacingOccurrences' 最佳答案 试试这个,在swift3中工作varnewPassword=password.replacingOccurrences(of:"a",with:"A