@@ -39,15 +39,13 @@ extension StringCaseConversionsOnStringExtension on String {
39
39
String toUpperDotCase () => this .toDotCase ().toUpperCase ();
40
40
41
41
/// Converts the string to path/case.
42
- String toPathCase ([String separator = '/' ]) =>
43
- this .extractLowercaseComponents ().join (separator);
42
+ String toPathCase ([String separator = '/' ]) => this .extractLowercaseComponents ().join (separator);
44
43
45
44
/// Converts the string to camelCase.
46
45
String toCamelCase () => this .toPascalCase ().withFirstLetterAsLowerCase ();
47
46
48
47
/// Converts the string to PascalCase.
49
- String toPascalCase () =>
50
- this .extractLowercaseComponents ().map ((e) => e.capitalize ()).join ();
48
+ String toPascalCase () => this .extractLowercaseComponents ().map ((e) => e.capitalize ()).join ();
51
49
52
50
/// Extracts and returns a list of lowercase components from the string.
53
51
///
@@ -62,12 +60,12 @@ extension StringCaseConversionsOnStringExtension on String {
62
60
///
63
61
/// Example:
64
62
/// ```dart
65
- /// var example = 'HelloWorld123+ 456';
66
- /// var components = example.extractLowercaseComponents(special = const {'+ '});
63
+ /// var example = 'HelloWorld123. 456';
64
+ /// var components = example.extractLowercaseComponents(special = const {'. '});
67
65
/// print(components); // Output: ['hello', 'world', '123+456']
68
66
/// ```
69
67
List <String > extractLowercaseComponents ({
70
- Set <String > special = const {'+ ' },
68
+ Set <String > special = const {'. ' },
71
69
}) {
72
70
if (this .isEmpty) return [this ];
73
71
final words = < String > [];
@@ -109,12 +107,10 @@ extension StringCaseConversionsOnStringExtension on String {
109
107
bool get isLetter => RegExp (r'^[a-zA-Z]$' ).hasMatch (this );
110
108
111
109
/// Returns `true` if the string is all uppercase.
112
- bool get isUpperCase =>
113
- this == this .toUpperCase () && this != this .toLowerCase ();
110
+ bool get isUpperCase => this == this .toUpperCase () && this != this .toLowerCase ();
114
111
115
112
/// Returns `true` if the string is all lowercase.
116
- bool get isLowerCase =>
117
- this == this .toLowerCase () && this != this .toUpperCase ();
113
+ bool get isLowerCase => this == this .toLowerCase () && this != this .toUpperCase ();
118
114
119
115
/// Capitalizes the first letter of the string.
120
116
///
0 commit comments