title: How to trim(remove) white spaces from end of a NSAttributedString
body: <p>I have a string which has no whitespace at end of the string but when I am converting to <code>NSAttributedString</code> and set to <code>UITextView</code> it was seen some whitespace at end of the <code>UILabel</code>.</p>
  
  <p>For making <code>NSAttributedString</code> I am using following code. In my code <code>expectedLabelSize</code> gives a big height.</p>
  
  <pre><code>UILabel *tempLbl = [[UILabel alloc]init];
  tempLbl.font = txtView.font;
  tempLbl.text = string;
  
  NSDictionary *dictAttributes = [NSDictionary dictionaryWithObjectsAndKeys: tempLbl.font, NSFontAttributeName, aParaStyle, NSParagraphStyleAttributeName,[UIColor darkGrayColor],NSForegroundColorAttributeName, nil];
  
  CGSize expectedLabelSize = [string boundingRectWithSize:maximumLabelSize options:NSStringDrawingUsesLineFragmentOrigin attributes:dictAttributes context: nil].size;
  </code></pre>