NSString(TKCategory) Category Reference
Declared in | NSString+TKCategory.h NSString+TKCategory.m |
Tasks
-
email
property -
stripWhitespace
property -
stripWhitepspaceAndNewlines
property -
URLEncode
property -
escapeHTML
property -
unescapeHTML
property -
stringByRemovingHTML
property -
md5sum
property -
– hasString:
-
lengthWithoutWhitespace
property -
stringWithoutWhitespace
property -
creditCardType
property -
validCreditCardNumber
property -
– formattedPhoneNumberWithLastCharacterRemoved:
Properties
URLEncode
Returns a NSString
that is URL friendly.
@property (nonatomic, readonly, copy) NSString *URLEncode
Return Value
A URL encoded string.
Declared In
NSString+TKCategory.h
creditCardType
Returns the credit card type based on the first for digits of the card number.
@property (nonatomic, readonly, copy) NSString *creditCardType
Return Value
A credit card company name if the number matches a company otherwise nil.
Declared In
NSString+TKCategory.h
Returns YES
if a string is a valid email address, otherwise NO
.
@property (nonatomic, getter=isEmail, readonly) BOOL email
Return Value
True if the string is formatted properly as an email address.
Declared In
NSString+TKCategory.h
escapeHTML
Returns a NSString
that properly replaces HTML specific character sequences.
@property (nonatomic, readonly, copy) NSString *escapeHTML
Return Value
An escaped HTML string.
Declared In
NSString+TKCategory.h
lengthWithoutWhitespace
Returns the length of the string minus the whitespace characters.
@property (nonatomic, readonly) NSUInteger lengthWithoutWhitespace
Return Value
Returns the length of the string minus the whitespace characters.
Declared In
NSString+TKCategory.h
md5sum
Returns an MD5 string of from the given NSString
.
@property (nonatomic, readonly, copy) NSString *md5sum
Return Value
A MD5 string.
Declared In
NSString+TKCategory.h
stringByRemovingHTML
Returns a NSString
that removes HTML elements.
@property (nonatomic, readonly, copy) NSString *stringByRemovingHTML
Return Value
Returns a string without the HTML elements.
Declared In
NSString+TKCategory.h
stringWithoutWhitespace
Returns a string without the whitespace characters.
@property (nonatomic, readonly) NSString *stringWithoutWhitespace
Return Value
Returns a string without the whitespace characters.
Declared In
NSString+TKCategory.h
stripWhitepspaceAndNewlines
Returns a NSString
that removes blank space and new lines from the start and end of string.
@property (nonatomic, readonly, copy) NSString *stripWhitepspaceAndNewlines
Return Value
A stripped string.
Declared In
NSString+TKCategory.h
stripWhitespace
Returns a NSString
that removes blank space from the start and end of string.
@property (nonatomic, readonly, copy) NSString *stripWhitespace
Return Value
A stripped string.
Declared In
NSString+TKCategory.h
unescapeHTML
Returns a NSString
that properly formats text for HTML.
@property (nonatomic, readonly, copy) NSString *unescapeHTML
Return Value
An unescaped HTML string.
Declared In
NSString+TKCategory.h
validCreditCardNumber
Returns YES if the card number passes the Luhn algorithm. No spaces in the card number.
@property (nonatomic, getter=isValidCreditCardNumber, readonly) BOOL validCreditCardNumber
Return Value
Returns YES if the card is a valid credit card number, otherwise NO.
Declared In
NSString+TKCategory.h
Instance Methods
formattedPhoneNumberWithLastCharacterRemoved:
Returns a formatted phone number. So it’d transform a string 18005555555 would be 1-800-555-5555.
- (NSString *)formattedPhoneNumberWithLastCharacterRemoved:(BOOL)deleteLastChar
Parameters
- deleteLastChar
Remove the last character from the string.
Return Value
Returns an NSString
that transform a string of numbers into a string human readable phone number.
Declared In
NSString+TKCategory.h