import Glibc var nounArray = ["puppy", "laptop", "ocean", "app", "cow", "skateboard", "developer", "coffee", "moon"] var index1 = Int(random() % 9) var index2 = Int(random() % 9) var sentence = "The \(nounarray[6]) spilled her \(nounArray[7])." var sillySentence = "The \(nounArray[index1]) jumped over the \(nounArray[index2])." print(sentence) print(sillySentence)
var eString = "Meet me in St. Louis" for character in eString.characters { if character == "e" { print("found an e!") } else { } }
var eString = "Meet me in St. Louis" for character in eString.characters { if character == "e" { print("found an e!") } else { } } var theTruth = "Mony can buy me love." var characterCount = theTruth.characters.count var forwardString = "spoons" var charactersReversed = forwardString.characters.reversed() var backwardsString = String(charactersReversed) print(backwardsString)
found an e! found an e! found an e! snoops