wip: convert_utils_tests

This commit is contained in:
DenserMeerkat
2024-07-29 00:23:58 +05:30
parent 289c7c73ea
commit cfcf448664
7 changed files with 80 additions and 49 deletions

View File

@ -1,5 +1,11 @@
extension StringExtension on String {
String capitalize() {
if (isEmpty) {
return this;
}
if (length == 1) {
return toUpperCase();
}
return "${this[0].toUpperCase()}${substring(1).toLowerCase()}";
}