NSString(GBString) Category Reference
| Declared in | NSString+GBString.h NSString+GBString.m  | 
Tasks
Simplifying strings
- 
	
		
– stringByTrimmingCharactersInSetFromEnd:Trims all characters from the given set from the string end. - 
	
		
– stringByWordifyingWithSpacesSplits the string to words and returns all words separed by single space. - 
	
		
– stringByTrimmingWhitespaceTrims all whitespace from the start and end of the string and returns trimmed value. - 
	
		
– stringByTrimmingWhitespaceAndNewLineTrims all whitespace and new lines from the start and end of the string and returns trimmed value. 
Preparing nice descriptions
- 
	
		
– normalizedDescriptionReturns normalized description from the receiver. - 
	
		
– normalizedDescriptionWithMaxLength:Returns normalized description from the receiver. - 
	
		
+ defaultNormalizedDescriptionLengthReturns default maximum length of normalized string. 
Getting information
- 
	
		
+ stringByCombiningLines:delimitWith:Creates a newNSStringcomposed from all given lines delimited with the given delimiter. - 
	
		
– arrayOfLinesReturns the array of all lines in the receiver. - 
	
		
– numberOfLinesReturns the number of all lines in the receiver. - 
	
		
– numberOfLinesInRange:Calculates the numer of lines in the given range of the receiver. 
Other Methods
- 
	
		
– stringByTrimmingCharactersInSetFromEnd:Trims all characters from the given set from the string end. - 
	
		
– stringByWordifyingWithSpacesSplits the string to words and returns all words separed by single space. - 
	
		
– stringByTrimmingWhitespaceTrims all whitespace from the start and end of the string and returns trimmed value. - 
	
		
– stringByTrimmingWhitespaceAndNewLineTrims all whitespace and new lines from the start and end of the string and returns trimmed value. - 
	
		
– normalizedDescriptionReturns normalized description from the receiver. - 
	
		
– normalizedDescriptionWithMaxLength:Returns normalized description from the receiver. - 
	
		
+ defaultNormalizedDescriptionLengthReturns default maximum length of normalized string. - 
	
		
+ stringByCombiningLines:delimitWith:Creates a newNSStringcomposed from all given lines delimited with the given delimiter. - 
	
		
– arrayOfLinesReturns the array of all lines in the receiver. - 
	
		
– numberOfLinesReturns the number of all lines in the receiver. - 
	
		
– numberOfLinesInRange:Calculates the numer of lines in the given range of the receiver. 
Class Methods
defaultNormalizedDescriptionLength
Returns default maximum length of normalized string.
+ (NSUInteger)defaultNormalizedDescriptionLengthDeclared In
NSString+GBString.hstringByCombiningLines:delimitWith:
Creates a new NSString composed from all given lines delimited with the given delimiter.
+ (NSString *)stringByCombiningLines:(NSArray *)lines delimitWith:(NSString *)delimiterParameters
- lines
 - Array of lines to combine.
 
- delimiter
 - Delimiter to use to separate lines.
 
Return Value
Returns autoreleased string containing all lines.
Declared In
NSString+GBString.hInstance Methods
arrayOfLines
Returns the array of all lines in the receiver.
- (NSArray *)arrayOfLinesReturn Value
Returns the array of all lines.
See Also
Declared In
NSString+GBString.hnormalizedDescription
Returns normalized description from the receiver.
- (NSString *)normalizedDescriptionReturn Value
Returns stripped description.
Discussion
The main purpose of this method is to strip and wordifiy long descriptions by making them suitable for logging and debug messages.
Declared In
NSString+GBString.hnormalizedDescriptionWithMaxLength:
Returns normalized description from the receiver.
- (NSString *)normalizedDescriptionWithMaxLength:(NSUInteger)lengthParameters
- length
 - Maximum length of the description.
 
Return Value
Returns stripped description.
Discussion
The main purpose of this method is to strip and wordifiy long descriptions by making them suitable for logging and debug messages.
Declared In
NSString+GBString.hnumberOfLines
Returns the number of all lines in the receiver.
- (NSUInteger)numberOfLinesReturn Value
Returns the number of all lines in the receiver.
See Also
Declared In
NSString+GBString.hnumberOfLinesInRange:
Calculates the numer of lines in the given range of the receiver.
- (NSUInteger)numberOfLinesInRange:(NSRange)rangeParameters
- range
 - The range to use for calculation.
 
Return Value
Returns the number of lines in the given range.
Exceptions
- NSException
 - Thrown if the given range is invalid.
 
See Also
Declared In
NSString+GBString.hstringByTrimmingCharactersInSetFromEnd:
Trims all characters from the given set from the string end.
- (NSString *)stringByTrimmingCharactersInSetFromEnd:(NSCharacterSet *)setParameters
- set
 - The set of characters to trim.
 
Return Value
Returns trimmed string.
Discussion
Works the same way as [NSString stringByTrimmingCharactersInSetFromEnd:] except it trims from end only.
Exceptions
- NSException
 - Thrown if the given set is 
nil. 
Declared In
NSString+GBString.hstringByTrimmingWhitespace
Trims all whitespace from the start and end of the string and returns trimmed value.
- (NSString *)stringByTrimmingWhitespaceReturn Value
Returns trimmed string.
Declared In
NSString+GBString.h