ObjectiveC开发教程--字符串的连接

前端之家收集整理的这篇文章主要介绍了ObjectiveC开发教程--字符串的连接前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

NSString *type = @"hello";

NSString *subtype = @"good";

NSString *typesub = [NSString stringWithFormat:@"%@>%@",type,subtype];

NSString *typesub1 = [type stringByAppendingString:subtype];

NSString *typesub2 = [type stringByAppendingFormat:@"%@>%@",subtype];

NSString *a= @"abc" ;

NSString *typesub3 = [type stringByAppendingFormat:@"%@>%@>%@",subtype,a];

NSLog(@"%@,%@,%@",typesub,typesub1,typesub2,typesub3,typesub3);

原文链接:https://www.f2er.com/swift/326453.html

猜你在找的Swift相关文章