The difference between stringbyappendingpathcomponent, stringbyappendingstring and other statements

Source: Internet
Author: User

NSString *[email protected] "Hello"; NSString *[email protected] "world"; NSString *AND1=[A1 STRINGBYAPPENDINGSTRING:A2]; NSString *and2=[a1 stringbyappendingpathcomponent:a2];//append Append, path path, component composition NSString *AND3=[A1 Stringbyappendingpathextension:a2];//extension extended, extended (extension) nsstring *and4=[a1 stringbyappendingformat:@ "_123456_%@" , A2];//format format NSLog (@ "%@", AND1); NSLog (@ "%@", and2); NSLog (@ "%@", And3); NSLog (@ "%@", And4);/*******************************/2015-11-05 20:52:12.500 test[10068:192356] HelloWorld
2015-11-05 20:52:12.501 test[10068:192356] Hello/world
2015-11-05 20:52:12.501 test[10068:192356] hello.world
2015-11-05 20:52:12.502 test[10068:192356] Hello_ 123456_world/*******************************/

The difference between stringbyappendingpathcomponent, stringbyappendingstring and other statements

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.