How to truncate the string into required length in iphone sdk?

Posted by monish on Stack Overflow See other posts from Stack Overflow or by monish
Published on 2010-05-26T11:43:39Z Indexed on 2010/05/26 11:51 UTC
Read the original article Hit count: 172

Filed under:

Hi guys,

I am having a string which contains more the 25 characters;

NSString *str = @"This is the string to be truncated to 15 characters only";

In the above string I need only the 15 characters to be stored in another variable after truncation.

can anyone suggest me how to do this? Anyone's help will be much appreciated.

Thank you, Monish

© Stack Overflow or respective owner

Related posts about objective-c