title: check if a character is carriage return
body: <p>i would like to remove the last line from my string.. the nsstring object here is _text. My thoughts are to scan characters from the end and if i found a carriage return symbol i substring to that index, and finnish. But i don't want to remove every carriage return, just the last one.</p>
  
  <p>So i would like to do something like this:</p>
  
  <pre><code>for (int i = [_text length] ; i&gt;0; i--) {
      char character = [_text characterAtIndex:i];
      if (character == @"\n") {
         _text = [_text substringToIndex:i];
       return;
      }
  }
  </code></pre>
  
  <p>Any help would be very appreciated!
  Thanks.</p>