#在蓝懿学习iOSd的日子 #

Source: Internet
Author: User

#在蓝懿学习iOS的日子 # So we're going to review it today, the way we learned this time:

One, the conversion of numbers and texts I structure:

1. Convert the numbers into text:

L.text = [@ (X) stringvalue;

2. W converts the text into characters:

int a = L.text.intvalue;

Second, the concatenation of strings:

NSString * str1 = @ "abc";

nsstring * str2 = [nsstring string];

STR2 = @ "def";

1. Method One: Connect two strings together

nsstring * str3 = [nsstring stringwithformat:@ "%@%@", Str1,str2]

nsstring * STR4 = @ "4";

float pi =3.1415926535;

STR4 = [@ (pi) stringvalue];

STR4 = [nsstring stringwithformat:@ "%f", pi];

2, method Two: Connect a string behind another string;

nsstring * STR5 = [str1 stringbyappendingstring: str2];

NSLog(@ "STR5 =%@", STR5);

3, method Two: Is the method one and method two combination version:

nsstring * STR6 = [str1 stringbyappendingformat:@ "%@%f", str2,3.14];

The method is used and understood by the use of, to be more effective, before it can be used properly, please share the encouragement.

#在蓝懿学习iOSd的日子 #

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.