我有3个NSString和1个具有值的NSArray,我尝试将所有字符串转换为一个:

string01 = [string01 stringByAppendingString:[numbersValue objectAtIndex:Value1 -1]];
string03 = [string02 stringByAppendingString:[numbersValue objectAtIndex:Value2 -1]];
string03 = [string03 stringByAppendingString:[numbersValue objectAtIndex:Value3 -1]];

//here i will to convert value of striing01 in to string02 and string02 in to string03 than take last string in my UITextView

resulteString = [resulteString stringByAppendingString:<what i can write here?>];

[myTextView setText:resulteString];


就像一个谜机器,例如,如果您认为键盘并按A,

A pass inside a string01 and become B,
B pass inside a string02 and become C,
C pass inside string03 and become D
in my text view i need to see only D

最佳答案

如果resulteString是NSString类的对象
然后使用

resultString = [NSString stringWithFormat:@"%@%@%@%@", resultString,string01, string02, string03];


否则,如果resulteString是NSMutableString类的对象

   resulteString = [resulteString stringByAppendingFormat:@"%@%@%@", string01, string02, string03];


可能会帮助您。

08-26 03:54