qmathe@club-internet.fr
)NSString additions.
Copyright: (C) 2007 Quentin Mathe
- Declared in:
- NSString+Etoile.h
@group String Manipulation and Formatting
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'.
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.
Returns a new string instance by stripping the first path component as defined by -firstPathComponent .
Returns a string where the first letter is lowercased and the other letter case remains the same. Useful to create accessor names from Key-Value-Coding keys. See also -stringByCapitalizingFirstLetter .
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.
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.
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.