FurryChat/lib/utils/beautify_string_extension.dart

16 lines
351 B
Dart
Raw Normal View History

2020-02-04 13:42:35 +00:00
extension BeautifyStringExtension on String {
String get beautified {
2020-05-13 13:58:59 +00:00
var beautifiedStr = '';
for (var i = 0; i < length; i++) {
beautifiedStr += substring(i, i + 1);
2020-02-04 13:42:35 +00:00
if (i % 4 == 3) {
2020-05-13 13:58:59 +00:00
beautifiedStr += ' ';
2020-02-04 13:42:35 +00:00
}
if (i % 16 == 15) {
2020-05-13 13:58:59 +00:00
beautifiedStr += '\n';
2020-02-04 13:42:35 +00:00
}
}
return beautifiedStr;
}
}