NSString categories documentation
Etoile
NSString (Etoile)Default
- - (NSString *) substringFromIndex: (NSUInteger)startIndex toIndex: (NSUInteger)endIndex
Returns the substring that starts at the first index and ends at the second index.
The character located at the start index is included in the returned string, unlike the character located at the end index which isn't included. This is a convenient alternative to -substringWithRange: which tends to be error-prone for most use cases.
- - (NSString *) firstPathComponent
Returns the first path component of the receiver. If the receiver isn't a path, returns the a new instance of the entire string.
If the path is '/', returns '/'.
If the path is '/where/who' or 'where/who', returns 'where'.
- - (NSString *) stringByDeletingFirstPathComponent
Returns a new string instance by stripping the first path component as defined by -firstPathComponent .
- - (NSString *) stringByStandardizingIntoAbsolutePath
Returns a new string instance by first standardizing the path, then resolving remaining relative path components against the current directory to ensure the first path component is a '/' (the resulting path returns YES to -[NSString isAbsolutePath] ).
See also -[NSString stringByStandardizingPath] and -[NSFileManager currentDirectoryPath] .
For a current directory /home/john/documents , ../beach.jpg is resolved to /home/john/beach.jpg, and beach.jpg is resolved to /home/john/documents/beach.jpg.
- - (NSString *) stringBySpacingCapitalizedWords
Returns a string where all words are separated by spaces for a given string of capitalized words with no spaces at all.
Useful to convert a name in camel case into a more user friendly name.
- - (NSString *) stringByCapitalizingFirstLetter
Returns a string where the first letter is capitalized and the other letter case remains the same (unlike -capitalizedString). Useful to create accessor names from Key-Value-Coding keys.
ETUUID
NSString (ETUUID)Default
- + (NSString *) UUIDString
Returns an autoreleased UUID string representation (see ETUUID).