「swift」replacingOccurrencesで文字列を置換するサンプル

1.文字列置換
let cft = “123testData"
cft.replacingOccurrences(of: “ta", with: “ark")

2.文字列検索
let cft = “testData"
let range = cft.range(of: “D")
print(cft[range!])

Swift

Posted by arkgame