Skip to content

Commit

Permalink
refactor: Add string util
Browse files Browse the repository at this point in the history
  • Loading branch information
enrique-lozano committed Jan 12, 2025
1 parent f18ccdb commit 757c0be
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/core/extensions/string.extension.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ extension StringExtension on String {
String capitalize() {
return '${this[0].toUpperCase()}${substring(1).toLowerCase()}';
}

String? nullIfEmpty() {
return isEmpty ? null : this;
}
}

extension NullableStringExtensions<E> on String? {
Expand Down

0 comments on commit 757c0be

Please sign in to comment.