Objective-C
Objective-C
StringBuilder ReplaceWord
Demonstrates the ReplaceWord method.Chilkat Objective-C Downloads
#import <CkoStringBuilder.h>
CkoStringBuilder *sb = [[CkoStringBuilder alloc] init];
[sb Append: @"forest, lumber, lumberjack, jack, timberland"];
// The ReplaceWord method replaces word occurances.
// For example:
int numReplacements = [[sb ReplaceWord: @"lumber" replacement: @"timber"] intValue];
numReplacements = [[sb ReplaceWord: @"jack" replacement: @"joe"] intValue];
// The string content is now:
// forest, timber, lumberjack, joe, timberland
NSLog(@"%@",[sb GetAsString]);