title: Extracting a string with substringWithRange: gives "index out of bounds"
body: <p>When I try to extract a string from a larger string it gives me a range or index out of bounds error. I might be overlooking something really obvious here. Thanks.</p>
  
  <pre><code>NSString *title = [TBXML textForElement:title1];
  TBXMLElement * description1 = [TBXML childElementNamed:@"description" parentElement:item1];
  NSString *description = [TBXML textForElement:description1];
  NSMutableString *des1 = [NSMutableString stringWithString:description];
  
  //search for &lt;pre&gt; tag for its location in the string
  NSRange match;
  NSRange match1;
  match = [des1 rangeOfString: @"&lt;pre&gt;"];
  match1 = [des1 rangeOfString: @"&lt;/pre&gt;"];
  NSLog(@"%i,%i",match.location,match1.location);
  NSString *newDes = [des1 substringWithRange: NSMakeRange (match.location+5, match1.location-1)]; //&lt;---This is the line causing the error
  
  NSLog(@"title=%@",title);
  NSLog(@"description=%@",newDes);
  </code></pre>
  
  <p><strong>UPDATE: The 2nd part of the range is a length, not the endpoint. D'oh!</strong></p>