Showing
1 changed file
with
2 additions
and
2 deletions
@@ -499,14 +499,14 @@ class GetUtils { | @@ -499,14 +499,14 @@ class GetUtils { | ||
499 | 499 | ||
500 | /// Capitalize each word inside string | 500 | /// Capitalize each word inside string |
501 | /// Example: your name => Your Name, your name => Your name | 501 | /// Example: your name => Your Name, your name => Your name |
502 | - static String? capitalize(String value) { | 502 | + static String capitalize(String value) { |
503 | if (isBlank(value)!) return value; | 503 | if (isBlank(value)!) return value; |
504 | return value.split(' ').map(capitalizeFirst).join(' '); | 504 | return value.split(' ').map(capitalizeFirst).join(' '); |
505 | } | 505 | } |
506 | 506 | ||
507 | /// Uppercase first letter inside string and let the others lowercase | 507 | /// Uppercase first letter inside string and let the others lowercase |
508 | /// Example: your name => Your name | 508 | /// Example: your name => Your name |
509 | - static String? capitalizeFirst(String s) { | 509 | + static String capitalizeFirst(String s) { |
510 | if (isBlank(s)!) return s; | 510 | if (isBlank(s)!) return s; |
511 | return s[0].toUpperCase() + s.substring(1).toLowerCase(); | 511 | return s[0].toUpperCase() + s.substring(1).toLowerCase(); |
512 | } | 512 | } |
-
Please register or login to post a comment