Without getting into to much detail about the actual program,I want to take an existing string and add more characters(or strings) to it. If this were done in java it would be like this
String x= "hello"
x= x + "world";
I currently have my string trying to do that like this. My string declared is called _whatiscorrect, it is an empty string right now and in this example i want to take the existing string and add an "o" to it.
_whatiscorrect = [_whatiscorrect stringByAppendingString:@"o"]; // place an o in the string
How do i do this?
You have the right idea. Just do this:
NSMutableString * _whatiscorrect = [[NSMutableString alloc] initWithString: @".."];
[_whatiscorrect appendString:@"o"];
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With