mirror of
https://github.com/foss42/apidash.git
synced 2025-06-30 12:57:27 +08:00
wip: convert_utils_tests
This commit is contained in:
@ -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()}";
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user