File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed
packages/netglade_utils/lib/src/extensions Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -10,11 +10,13 @@ extension StringExtensions on String {
10
10
/// - '\t'
11
11
///
12
12
/// When you only need to check exactly empty, use `isEmpty` .
13
- ///
13
+ ///
14
14
/// * String is blank when it contains only whitespaces.
15
15
bool get isBlank => trim ().isEmpty;
16
16
17
17
/// Returns negation of [isBlank] .
18
+ ///
19
+ /// * String is blank when it contains only whitespaces.
18
20
bool get isNotBlank => ! isBlank;
19
21
20
22
/// Returns last N characters.
@@ -27,18 +29,22 @@ extension StringExtensions on String {
27
29
extension NullableStringExtensions on String ? {
28
30
/// Returns true when `this` is `String` which is `isBlank` .
29
31
/// When the value is `null` , returns `false` .
30
- ///
31
- /// * String? is blank when it has a value and contains only whitespaces.
32
+ ///
33
+ /// * String? is blank when it has a value and contains only whitespaces.
32
34
bool get isBlank {
33
35
return this ? .isBlank ?? false ;
34
36
}
35
37
36
38
/// Returns true when `this` is either `null` or `isBlank` .
39
+ ///
40
+ /// * String? is blank when it has a value and contains only whitespaces.
37
41
bool get isNullOrBlank {
38
42
return this ? .isBlank ?? true ;
39
43
}
40
44
41
45
/// Returns negation of [isBlank] .
46
+ ///
47
+ /// * String? is blank when it has a value and contains only whitespaces.
42
48
bool get isNotBlank {
43
49
return ! isBlank;
44
50
}
You can’t perform that action at this time.
0 commit comments