in Swift4, the String is Collections. You will no longer use characters property on a string.
func swapCharacters(input:String,index1:Int,index2:Int)-> String { // logic to swap }
let input = "ABCDEFGH"
If I call the function with (input,3,8) then the output should be
Output : ABCHEFGD
Note: In Swift4, Strings are collections.