string_extensions.dart
4.05 KB
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
import '../get_utils/get_utils.dart';
extension GetStringUtils on String {
/// Discover if the String is a valid number
bool get isNum => GetUtils.isNum(this);
/// Discover if the String is numeric only
bool get isNumericOnly => GetUtils.isNumericOnly(this);
String numericOnly({bool firstWordOnly = false}) =>
GetUtils.numericOnly(this, firstWordOnly: firstWordOnly);
/// Discover if the String is alphanumeric only
bool get isAlphabetOnly => GetUtils.isAlphabetOnly(this);
/// Discover if the String is a boolean
bool get isBool => GetUtils.isBool(this);
/// Discover if the String is a vector
bool get isVectorFileName => GetUtils.isVector(this);
/// Discover if the String is a ImageFileName
bool get isImageFileName => GetUtils.isImage(this);
/// Discover if the String is a AudioFileName
bool get isAudioFileName => GetUtils.isAudio(this);
/// Discover if the String is a VideoFileName
bool get isVideoFileName => GetUtils.isVideo(this);
/// Discover if the String is a TxtFileName
bool get isTxtFileName => GetUtils.isTxt(this);
/// Discover if the String is a Document Word
bool get isDocumentFileName => GetUtils.isWord(this);
/// Discover if the String is a Document Excel
bool get isExcelFileName => GetUtils.isExcel(this);
/// Discover if the String is a Document Powerpoint
bool get isPPTFileName => GetUtils.isPPT(this);
/// Discover if the String is a APK File
bool get isAPKFileName => GetUtils.isAPK(this);
/// Discover if the String is a PDF file
bool get isPDFFileName => GetUtils.isPDF(this);
/// Discover if the String is a HTML file
bool get isHTMLFileName => GetUtils.isHTML(this);
/// Discover if the String is a URL file
bool get isURL => GetUtils.isURL(this);
/// Discover if the String is a Email
bool get isEmail => GetUtils.isEmail(this);
/// Discover if the String is a Phone Number
bool get isPhoneNumber => GetUtils.isPhoneNumber(this);
/// Discover if the String is a DateTime
bool get isDateTime => GetUtils.isDateTime(this);
/// Discover if the String is a MD5 Hash
bool get isMD5 => GetUtils.isMD5(this);
/// Discover if the String is a SHA1 Hash
bool get isSHA1 => GetUtils.isSHA1(this);
/// Discover if the String is a SHA256 Hash
bool get isSHA256 => GetUtils.isSHA256(this);
/// Discover if the String is a bynary value
bool get isBinary => GetUtils.isBinary(this);
/// Discover if the String is a ipv4
bool get isIPv4 => GetUtils.isIPv4(this);
bool get isIPv6 => GetUtils.isIPv6(this);
/// Discover if the String is a Hexadecimal
bool get isHexadecimal => GetUtils.isHexadecimal(this);
/// Discover if the String is a palindrom
bool get isPalindrom => GetUtils.isPalindrom(this);
/// Discover if the String is a passport number
bool get isPassport => GetUtils.isPassport(this);
/// Discover if the String is a currency
bool get isCurrency => GetUtils.isCurrency(this);
/// Discover if the String is a CPF number
bool get isCpf => GetUtils.isCpf(this);
/// Discover if the String is a CNPJ number
bool get isCnpj => GetUtils.isCnpj(this);
/// Discover if the String is a case insensitive
bool isCaseInsensitiveContains(String b) =>
GetUtils.isCaseInsensitiveContains(this, b);
/// Discover if the String is a case sensitive and contains any value
bool isCaseInsensitiveContainsAny(String b) =>
GetUtils.isCaseInsensitiveContainsAny(this, b);
/// capitalize the String
String? get capitalize => GetUtils.capitalize(this);
/// Capitalize the first letter of the String
String? get capitalizeFirst => GetUtils.capitalizeFirst(this);
/// remove all whitespace from the String
String get removeAllWhitespace => GetUtils.removeAllWhitespace(this);
/// converter the String
String? get camelCase => GetUtils.camelCase(this);
/// Discover if the String is a valid URL
String? get paramCase => GetUtils.paramCase(this);
/// add segments to the String
String createPath([Iterable? segments]) {
final path = startsWith('/') ? this : '/$this';
return GetUtils.createPath(path, segments);
}
}