title: Understanding the removeRange(_:) documentation
body: <blockquote>
    <p>To remove a substring at a specified range, use the removeRange(_:)
    method:</p>
  
  <pre><code>1 let range = advance(welcome.endIndex, -6)..&lt;welcome.endIndex
  2 welcome.removeRange(range)
  3 println(welcome)
  4 // prints "hello"
  </code></pre>
    
    <p>Excerpt From: Apple Inc. “The Swift Programming Language.” iBooks.
    <a href="https://itun.es/ca/jEUH0.l" rel="noreferrer">https://itun.es/ca/jEUH0.l</a></p>
  </blockquote>
  
  <p>Hi there,  </p>
  
  <p>I don't fully understand the syntax and the function of line 1 in the code above.  </p>
  
  <p>Please explain using this string:</p>
  
  <pre><code>let welcome = "hello there"
  </code></pre>
  
  <hr>
  
  <p>This is what I've worked out:  </p>
  
  <blockquote>
    <p>"To change the start and end index, use <code>advance()</code>."<br>
    From: <a href="https://stackoverflow.com/a/24045156/4839671">https://stackoverflow.com/a/24045156/4839671</a></p>
  </blockquote>
  
  <p>A better documentation of <code>advance()</code> is welcomed. i.e. it's arguments</p>
  
  <blockquote>
    <p>Use <code>..&lt;</code> to make a range that omits its upper value</p>
    
    <p>Excerpt From: Apple Inc. “The Swift Programming Language.” iBooks. <a href="https://itun.es/ca/jEUH0.l" rel="noreferrer">https://itun.es/ca/jEUH0.l</a></p>
  </blockquote>
  
  <p><code>welcome.endIndex</code> will be 11</p>