Substring from NSString [closed]
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 5 years ago . I am using NSString and I want to get a substring of it that contains the first 20 characters of my string. How can I do that? 回答1: You can use substringToIndex . NSString *mystring = @"This is a test message having more than 20 characters"; NSString *newString = [mystring