1+ import 'package:super_string/super_string.dart' ;
2+
3+ void main () {
4+
5+ /// [isUpperCase]
6+ print ('this' .isUpperCase); // => false
7+ print ('THIS' .isUpperCase); // => true
8+
9+ /// [isLowerCase]
10+ print ('this' .isLowerCase); // => true
11+ print ('THIS' .isLowerCase); // => false
12+
13+ /// [isAlNum]
14+ print ('This123' .isAlNum); // => true
15+ print ('123' .isAlNum); // => true
16+ print ('This@123' .isAlNum); // => false
17+
18+ /// [isAlpha]
19+ print ('This' .isAlpha); // => true
20+ print ('A1' .isAlpha); // => false
21+ print ('This@123' .isAlpha); // => false
22+
23+ /// [isInteger]
24+ print ('This123' .isInteger); // => false
25+ print ('123' .isInteger); // => true
26+ print ('This@123' .isInteger); // => false
27+
28+ /// [isIdentifier]
29+ print ('This123' .isIdentifier); // => true
30+ print ('This 123' .isIdentifier); // => false
31+ print ('123This' .isIdentifier); // => false
32+ print ('This@123' .isIdentifier); // => false
33+ print ('This_123' .isIdentifier); // => true
34+
35+ /// [title]
36+ print ('this123' .title ()); // => 'This123'
37+ print ('This is title' .title ()); // => 'This Is Title'
38+ print ('tHiS iS tiTle' .title ()); // => 'This Is Title'
39+
40+ /// [swapcase]
41+ print ('tHiS' .swapcase ()); // => 'ThIs'
42+ print ('HeLlO' .swapcase ()); // => 'hElLo'
43+
44+ /// [charAt]
45+ print ('This' .charAt (0 )); // => 'T'
46+ print ('This' .charAt (3 )); // => 's'
47+
48+ /// [similarity]
49+ print ('This' .similarity ('This' )); // => 4
50+ print ('this' .similarity ('THis' )); // => 2
51+
52+ /// [capitalize]
53+ print ('this' .capitalize ()); // => 'This'
54+ print ('THIS' .capitalize ()); // => 'This'
55+
56+ /// [center]
57+ print ('this' .center (6 )); // => ' this ';
58+ print ('this' .center (7 ,'0' )); // => '00this0'
59+
60+ /// [count]
61+ print ('this' .count ('t' )); // => 1
62+ print ('hello' .count ('l' )); // => 2
63+ print ('hello' .count ('l' ,0 ,3 )); // => 1
64+
65+ /// [expandTabs]
66+ print ('a\t a' .expandTabs ()); // => 'a a'
67+ print ('a\t a' .expandTabs (2 )); // => 'a a'
68+ }
0 commit comments