Nsstring cannot be modified string-objective-C

Source: Internet
Author: User

Summary of common nsstring Methods
+ (ID) stringwithcontentsoffile: path encoding: ENC err Create a new string and set it to the content of the file specified by path. Use the character encoding ENC to return an error on err.
+ (ID) stringwithcontentsofurl: URL encoding: ENC err Create a new string and set it to the content pointed to by the URL. Use the character encoding ENC to return an error on err.
+ (ID) String Create a new Null String
+ (ID) stringwithstring: nsstring Create a new string and set its content to nsstring
-(ID) initwithstring: nsstring Set the string content to nsstring content
-(ID) initwithcontentsoffile: path encoding: ENC error: Err SetStringSet to path to specify the file content, use character encoding ENC, and return an error on err
-(ID) initwithcontentsofurl: URL encoding: ENC error: Err Sets the string to the content pointed to by the URL, uses the character encoding ENC, and returns an error on err
-(Unsigned INT) Length Returns the number of characters in a string.
-(Unichar) characteratindex: I Returns the Unicode Character of index I.
-(Nsstring *) substringfromindex: I Returns the substring from index I to the end.
-(Nsstring *) substringwithrange: Range Returns a substring based on a specified range.
-(Nsstring *) substringtoindex: I Returns the substring from the string to the index I.
-(Nscomparator *) caseinsensitivecompare: nsstring Compare the two string sizes, case insensitive
-(Nscomparator *) compare: nsstring Compare two string sizes
-(Bool) hasprefix: nsstring Test whether the string starts with nsstring
-(Bool) hassuffix: nsstring Test whether the string ends with nsstring
-(Bool) isw.tostring: nsstring Test whether two strings are equal
-(Nsstring *) capitalizedstring Returns a string. the first letter of each word in the string is uppercase, And the other letters are lowercase.
-(Nsstring *) lowercasestring Returns a string converted to lowercase.
-(Nsstring *) uppercasestring Returns a string converted to uppercase.
-(Const char *) utf8string Returns a UTF-8 encoded string.
-(Double) doublevalue Returns a string converted to the double type.
-(Float) floatvalue Returns a string converted to the float type.
-(Nsinteger) integervalue Returns a new string converted to the nsinteger type.
-(INT) intvalue Returns the string converted to int.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.