Matching string characters
Code
func allCharactersPresent(_ str: String, _ str1: String) -> Bool {
var charc = Array(str)
var charc1 = Array(str1)
var charPresent = false
for i in 0..<charc.count {
charPresent = false
for j in 0..<charc1.count {
if charc[i] == charc1[j] {
charc1[j] = "."
charPresent = true
}
}
if !charPresent {
return charPresent
}
}
return charPresent
}