[Feat] added String camelcase to title extension.
This commit is contained in:
@@ -18,8 +18,8 @@ extension StringExtensions on String {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Convert CamelCase to a capitalized space separated title.
|
/// Convert CamelCase to a capitalized space separated title.
|
||||||
String camelCaseToTitle(String input) {
|
String get camelCaseToTitle {
|
||||||
final String spaced = input.replaceAllMapped(
|
final String spaced = replaceAllMapped(
|
||||||
RegExp(r'([a-z])([A-Z])'),
|
RegExp(r'([a-z])([A-Z])'),
|
||||||
(Match match) => '${match.group(1)} ${match.group(2)}',
|
(Match match) => '${match.group(1)} ${match.group(2)}',
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user