title: Setting Max length of string/.text
body: <p>I use buttons to display letters in a bar now this is the code I use</p>
  
  <pre><code>-(IBAction) clicked: (id)sender{
  NSString *titleOfButton = [sender titleForState:UIControlStateNormal];
  NSString *newLabelText = titleOfButton;
  labelsText.text = [NSString stringWithFormat:@"%@%@", labelsText.text, newLabelText];
  
   //if ([newLabelText length] &gt;= 5) newLabelText = [newLabelText substringToIndex:5];
   }
  </code></pre>
  
  <p>The problem I got is that I want it to be able to put in 5 letters max Is there anyone who can tell me how to do this?</p>
  
  <p>thanks</p>