title: How do I remove a substring from a string using NSRegularExpression?
body: <p>I am trying to remove a particular part of a string and so far I decided to use RegEx to match the part of the string I would like to remove, but after that I'm not sure how to then remove that particular range from the original string...</p>
  
  <p>I am trying to change <code>333-333 Anywhere Lane</code> to <code>333 Anywhere Lane</code>.  Basically I am trying to remove any additional numerical digits after the hyphen.</p>
  
  <p>Here is my code:</p>
  
  <pre><code>address = @"333-333 Anywhere Lane";
  
  NSError *error = NULL;
  
  NSRegularExpression *regex = [NSRegularExpression regularExpressionWithPattern:@"-[0-9]*" options:NSRegularExpressionCaseInsensitive error:&amp;error];
  
  NSRange rangeOfFirstMatch = [regex rangeOfFirstMatchInString:address options:0 range:NSMakeRange(0, [address length])];
  
  NSLog(@"range of match = %d", rangeOfFirstMatch);
  
  if (!NSEqualRanges(rangeOfFirstMatch, NSMakeRange(NSNotFound, 0))) {
  
      address = [address substringWithRange:rangeOfFirstMatch];
      NSLog(@"substring = %@", address8);
      //i cant get the -333 but i don't know how to remove that..             
  
  }
  </code></pre>
  
  <p>Any ideas??</p>
  
  <p>Thank you in advance!</p>