-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathNSString+Extensions.h
executable file
·45 lines (25 loc) · 1.07 KB
/
NSString+Extensions.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#import <UIKit/UIKit.h>
@interface NSString (Data)
+ (id) stringWithData: (NSData*) data;
+ (NSString*) stringWithCString: (const char *) cString;
- (id) data;
@end
@interface NSString (Extensions)
- (BOOL) hasSubstring: (id) theString;
- (NSString*) escapedString;
- (NSString*) unescapedString;
- (NSString*) stringByRemovingHTMLEntities;
- (NSRange) rangeBetween: (NSString*) a and: (NSString*) b;
- (NSString*) substringBetween: (NSString*) a and: (NSString*) b;
- (NSString*) stringByRemovingPrefix: (NSString*) thePrefix;
- (NSString*) stringByRemovingSuffix: (NSString*) theSuffix;
- (NSString*) trimmedString;
- (NSString*) stringByReplacingString: (id) a withString: (id) b;
@end
@interface NSMutableString (Replace)
- (void) appendStringA: (id) theString;
- (unsigned int) replaceOccurrencesOfString: (NSString*) target withString: (NSString*) replacement;
@end
@interface NSString (UIKitDrawing)
- (CGSize) drawInRect: (CGRect) theRect highlightedString: (NSString*) highlightedString normalFont: (UIFont*) normalFont highlightedFont: (UIFont*) highlightedFont;
@end