ios - NSMutableString appendString vs appendFormat, which is more efficient? -


given this:

nsstring *innerxml = @"somevalue"; nsmutablestring *xml = [[nsmutablestring alloc] init]; 

which of these faster; not asking readability, subjective:

1.

[xml appendformat:@"<randomelement>%@</randomelement>", innerxml]; 

2.

[xml appendstring:@"<randomelement>"]; [xml appendstring:innerxml]; [xml appendstring:@"</randomelement>"]; 

if curious implementation read source code, available online, see: cfstring.c.

essentially core foundation code available part of opensourceing of darwin kernel.


Comments

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

Rendering JButton to get the JCheckBox behavior in a JTable by using images does not update my table -