Nu Class Reference

NSString Extensions

NSString extensions for Nu programming.

Declared in: nu/doc.nu, objc/extensions.h, nu/beautify.nu, tools/nuke, nu/generate.nu, nu/template.nu, tools/nubake

NSString extensions for Nu programming.

Methods

+ (id) carriageReturn
Get string consisting of a single carriage return character.

in objc/extensions.h

+ (id) spaces: (id) count
Create a string consisting of the specified number of spaces.

in nu/beautify.nu

+ (id) spaces: (id) count
Create a string consisting of the specified number of spaces.

in tools/nuke

+ (NSString *) stringWithCharacter: (unichar) c
Create a string from a specified character

in objc/extensions.h

+ (NSString *) stringWithShellCommand: (NSString *) command
Run a shell command and return its results in a string.

in objc/extensions.h

+ (NSString *) stringWithShellCommand: (NSString *) command
standardInput: (id) input
Run a shell command with the specified data or string as standard input and return the results in a string.

in objc/extensions.h

- characterArray
Output a string as an array of ints. This way we don't have to worry about escaping special characters. Beware -- this does not correctly handle UTF-8. You will get compilation warnings for characters that are out-of-range.

in tools/nubake

- (id) beginsWithString: (id) string
Test to see whether a string begins with a specified substring.

in nu/doc.nu

- (id) beginsWithString: (id) string
Test to see whether a string begins with a specified substring.

in tools/nuke

- (id) capitalizeFirstCharacter
Capitalize the first character of a string.

in nu/generate.nu

- (NSString *) chomp
If the last character is a newline, return a new string without it.

in objc/extensions.h

- (id) dirName
Get the directory name component of a file name.

in tools/nuke

- (id) each: (NuBlock *) block
Iterate over each character in a string, evaluating the provided block for each character.

in objc/extensions.h

- (NSString *) escapedStringRepresentation
Get a representation of the string that can be used in Nu source code.

in objc/extensions.h

- (id) evalWithContext: (NSMutableDictionary *) context
Evaluation operator. In Nu, strings may contain embedded Nu expressions that are evaluated when this method is called. Expressions are wrapped in #{...} where the ellipses correspond to a Nu expression.

in objc/extensions.h

- (id) fileName
Get the file name component of a file name.

in tools/nuke

- (int) lastCharacter
Get the last character of a string.

in nu/generate.nu

- (id) lastCharacter
Get the last character of a string.

in nu/template.nu

- (NSArray *) lines
Split a string into lines.

in objc/extensions.h

- (id) stringByReplacingPathExtensionWith: (id) newExtension
Change the extension at the end of a file name to a new specified value.

in tools/nuke

- (id) strip
Create a copy of a string with leading and trailing whitespace removed.

in nu/beautify.nu

- (id) strip
Create a copy of a string with leading whitespace removed.

in nu/doc.nu

- (id) stripParens
Remove the parentheses surrounding a string.

in nu/generate.nu

- (id) symbolValue
Convert a string into a symbol.

in objc/extensions.h

- (id) writeToFile: (id) fileName
Shorthand method to write files using UTF8 encodings.

in nu/doc.nu