User Tools

Site Tools


Sidebar

Programming Reference/Librarys

Question & Answer

Q&A is closed







objective-c:foundation.framework:nsstring.h:stringbyappendingstring

stringByAppendingString

    -(NSString *)stringByAppendingString:(NSString *)aString;    

Returns a new string made by appending a given string to the receiver.

ObjC Sourcecode Example

  NSString *cycle=@"Pass";
 
        for(int a=0; a<5; a++)
        {
 
            NSString *intValue=[NSString stringWithFormat:@"%i", a];
 
            cycle=[cycle stringByAppendingString:intValue];
 
            NSLog(@"%@", cycle);
 
        }

Output for this example code

output:

 
2012-04-15 12:08:02.994 FoundationNSString[633:403] Pass0
2012-04-15 12:08:02.998 FoundationNSString[633:403] Pass01
2012-04-15 12:08:02.998 FoundationNSString[633:403] Pass012
2012-04-15 12:08:03.000 FoundationNSString[633:403] Pass0123
2012-04-15 12:08:03.001 FoundationNSString[633:403] Pass01234 

on the occasion of the current invasion of Russia in Ukraine

Russian Stop this War
objective-c/foundation.framework/nsstring.h/stringbyappendingstring.txt · Last modified: 2024/02/16 01:12 (external edit)

Impressum Datenschutz