mchess-client/lib/utils/passpharse.dart
2024-05-19 17:22:06 +02:00

16 lines
310 B
Dart

extension PassphraseURL on String {
String phraseToURL() {
var words = split(' ');
for (var i = 0; i < words.length; i++) {
words[i] = words[i].capitalize();
}
return words.join();
}
String capitalize() {
return "${this[0].toUpperCase()}${substring(1).toLowerCase()}";
}
}