-
Notifications
You must be signed in to change notification settings - Fork 13
/
NSStringX.h
56 lines (41 loc) · 1.26 KB
/
NSStringX.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
46
47
48
49
50
51
52
53
54
55
56
//
// NSStringX.h
//
// Copyright (c) 2014 Anthony Shoumikhin. All rights reserved under MIT license.
// mailto:[email protected]
//
#import <Foundation/Foundation.h>
@interface NSString (X)
/**
Get a first receiver's substring that matches a given regular expression.
@param pattern A regular expression pattern to use for substring search.
@param options Options for the given regular expression pattern.
@return A receiver's substring that matches a given regular expression, or nil otherwise.
*/
- (NSString *)substringWithRegularExpressionPattern:(NSString *)pattern options:(NSRegularExpressionOptions)options;
/**
Add percent escapes for special characters.
@return URL encoded string.
*/
- (NSString *)URLEncoded;
/**
Replace percent escapes with correspnding characters.
@return URL decoded string.
*/
- (NSString *)URLDecoded;
/**
Get MD5 hash.
@return MD5 hash sum of own contents.
*/
- (NSString *)MD5;
/**
Get SHA256 hash.
@return SHA256 hash sum of own contents.
*/
- (NSString *)SHA256;
/**
Get a string which has dashes according to pretty UUID representation.
@return A copy of a string with dashes according to pretty UUID representation or empty string, if initial string lenght is not equal to 32.
*/
- (NSString *)likeUUID;
@end