如何在 iPhone 中格式化或附加字符串? [英] How to format or append a string in iPhone?

查看:57
本文介绍了如何在 iPhone 中格式化或附加字符串?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想通过这种方式格式化字符串

I want to format the string by this way

NSString *title ;
- (void)uploadString:(NSString *)string
{


            title =glbl.text;
            NSMutableString *strRR = [[NSMutableString alloc] initWithString:title];
            [strRR appendFormat:@"%@ .html"];
            [self.googledocs beginUploadData:dataHtml withTitle:title inFolder:self.adirPath replaceExisting:NO];
}

glbl 是包含一些值的标签,例如 genesis1.3,我想用 .html 格式化这个字符串> genesis1.3.html.stRR 持有值genesis1.3,我想附加stRRwith.html`.这该怎么做?我在上面的代码中遇到了一些错误.提前致谢.

glbl is the label which holds some values like genesis1.3 and I want to format this string with .html that is genesis1.3.html. stRR is holding the valuegenesis1.3and I want to appendstRRwith.html`. How to do this? I got some error in the above code. Thanks in advance.

推荐答案

NSString * stRR = [NSString stringWithFormat:@"%@.html", title];

这篇关于如何在 iPhone 中格式化或附加字符串?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆