func firstCharacter(of word: String) -> Character { return word[word.startIndex] } firstCharacter(of: "Mom")
import Fundation func placeFirstLetterLast(myString: String){ }
func placeFirstLetterLast (myString: String) -> String { var myString = myString myString.append(firstCharacter(of: myString)) return myString } func shortNameFromName(name: String) -> String { let lowercaseName = name.lowercaseString let vowelSet = CharacterSet(charactersIn: "aeiou") } shortNameFromName(name: "Nate") // shortNameFromName(name: "Talia") //
func lyricsForName(lyricsTemplate: String, fullName: String) -> String { let shortName = shortNameForName(name: fullName) let lyrics = lyricsTemplate .replacingOccurrences(of: "<FULL_NAME>", with: fullName) .replacingOccurrences(of: "<SHORT_NAME>", with: shortName) return lyrics }