16 lines
310 B
Dart
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()}";
|
||
|
}
|
||
|
}
|