title: How to swap two characters in String Swift4?
body: <blockquote>
    <p><strong>in
    Swift4, the String is Collections.</strong> <strong>You will no longer use 
    characters property on a string.</strong></p>
  </blockquote>
  
  <pre><code>func swapCharacters(input:String,index1:Int,index2:Int)-&gt; String { // logic to swap }
  
  let input = "ABCDEFGH"
  </code></pre>
  
  <p>If I call the function with <strong>(input,3,8)</strong> then the output should be </p>
  
  <p><strong>Output :</strong> ABC<strong>H</strong>EFG<strong>D</strong></p>
  
  <p>Note: In Swift4, Strings are collections.</p>