Declared in NSString+KoboldKit.h

Overview

NSString category methods

Class Methods

replaceOccurancesOfString:withString:inFile:encoding:

Replaces occurances of string in a text file. Does nothing if file does not exist. File is written atomically.

+ (NSString *)replaceOccurancesOfString:(NSString *)search withString:(NSString *)replace inFile:(NSString *)file encoding:(NSStringEncoding)encoding

Parameters

search

The string to search for.

replace

The string to replace occurances of ‘search’ with.

file

The file (with optional path) in which to replace strings.

encoding

The NSStringEncoding used by the file.

Return Value

Returns the file contents with search string occurances replaced, or nil if there was an error in input or reading the file.

Declared In

NSString+KoboldKit.h

Instance Methods

color

String converted to SKColor object. The string must be in the form “1.0 1.0 1.0 1.0” where the values stand for the RGBA color values in the same order.

- (SKColor *)color

Return Value

String converted to SKColor object. The string must be in the form “1.0 1.0 1.0 1.0” where the values stand for the RGBA color values in the same order.

Declared In

NSString+KoboldKit.h

containsString:

Performs a case sensitive search for a substring. Returns YES if the string contains the substring.

- (BOOL)containsString:(NSString *)subString

Parameters

subString

The sub string to search for.

Return Value

YES if the subString is contained in the string.

Declared In

NSString+KoboldKit.h

pointValue

A CGPoint converted from a string point representation like “{300, 400}”.

- (CGPoint)pointValue

Return Value

A CGPoint converted from a string point representation like “{300, 400}”.

Declared In

NSString+KoboldKit.h

rectValue

A CGRect converted from a string rect representation like “{{10, 20}, {300, 400}}”.

- (CGRect)rectValue

Return Value

A CGRect converted from a string rect representation like “{{10, 20}, {300, 400}}”.

Declared In

NSString+KoboldKit.h

sizeValue

A CGSize converted from a string size representation like “{10, 20}”.

- (CGSize)sizeValue

Return Value

A CGSize converted from a string size representation like “{10, 20}”.

Declared In

NSString+KoboldKit.h

stringByDeletingIllegalFileSystemCharacters

Removes illegal filesystem characters from the string.

- (NSString *)stringByDeletingIllegalFileSystemCharacters

Return Value

The string with all illegal file system characters removed.

Declared In

NSString+KoboldKit.h

stringByDeletingIllegalXcodeCharacters

Removes characters from the string that are illegal to use in .xcodeproj bundle and related files.

- (NSString *)stringByDeletingIllegalXcodeCharacters

Return Value

The string with all illegal .xcodeproj characters removed.

Declared In

NSString+KoboldKit.h

stringByDeletingNonAsciiCharacters

Removes all characters not in the ASCII character set (decimal range 32-126).

- (NSString *)stringByDeletingNonAsciiCharacters

Return Value

The string with all non-ASCII characters removed.

Declared In

NSString+KoboldKit.h

stringByTrimmingWhiteSpaceCharacters

Removes whitespace and newline characters from the beginning and end of the string.

- (NSString *)stringByTrimmingWhiteSpaceCharacters

Return Value

The string with whitespace and newline characters trimmed.

Declared In

NSString+KoboldKit.h