Showing
2 changed files
with
7 additions
and
5 deletions
@@ -124,5 +124,8 @@ extension GetStringUtils on String { | @@ -124,5 +124,8 @@ extension GetStringUtils on String { | ||
124 | final path = startsWith('/') ? this : '/$this'; | 124 | final path = startsWith('/') ? this : '/$this'; |
125 | return GetUtils.createPath(path, segments); | 125 | return GetUtils.createPath(path, segments); |
126 | } | 126 | } |
127 | - String capitalizeAllWordsFirstLetter() => GetUtils.capitalizeAllWordsFirstLetter(this); | 127 | + |
128 | + /// capitalize only first letter in String words to upper case | ||
129 | + String capitalizeAllWordsFirstLetter() => | ||
130 | + GetUtils.capitalizeAllWordsFirstLetter(this); | ||
128 | } | 131 | } |
@@ -595,10 +595,9 @@ class GetUtils { | @@ -595,10 +595,9 @@ class GetUtils { | ||
595 | return numericOnlyStr; | 595 | return numericOnlyStr; |
596 | } | 596 | } |
597 | 597 | ||
598 | - /// capitalize the first letter of each word in a string | ||
599 | - /// Example: your name => Your Name | ||
600 | - /// Example 2 : this is an example text=> This Is An Example Text | ||
601 | - // "emm, lemme think !", | 598 | + /// Capitalize only the first letter of each word in a string |
599 | + /// Example: getx will make it easy => Getx Will Make It Easy | ||
600 | + /// Example 2 : this is an example text => This Is An Example Text | ||
602 | static String capitalizeAllWordsFirstLetter(String s) { | 601 | static String capitalizeAllWordsFirstLetter(String s) { |
603 | String lowerCasedString = s.toLowerCase(); | 602 | String lowerCasedString = s.toLowerCase(); |
604 | String stringWithoutExtraSpaces = lowerCasedString.trim(); | 603 | String stringWithoutExtraSpaces = lowerCasedString.trim(); |
-
Please register or login to post a comment