1
0
mirror of https://github.com/immich-app/immich.git synced 2024-12-21 01:39:59 +02:00
immich/mobile/lib/utils/capitalize.dart

10 lines
214 B
Dart
Raw Normal View History

extension StringExtension on String {
String capitalize() {
2023-06-27 19:28:15 +02:00
return split(" ")
.map(
(str) => str.isEmpty ? str : str[0].toUpperCase() + str.substring(1),
)
.join(" ");
}
}