mchess-client/lib/utils/passpharse.dart

16 lines
310 B
Dart
Raw Normal View History

2024-05-19 15:22:06 +00:00
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()}";
}
}