FurryChat/lib/utils/beautify_string_extension.dart
2020-05-13 13:58:59 +00:00

16 lines
351 B
Dart

extension BeautifyStringExtension on String {
String get beautified {
var beautifiedStr = '';
for (var i = 0; i < length; i++) {
beautifiedStr += substring(i, i + 1);
if (i % 4 == 3) {
beautifiedStr += ' ';
}
if (i % 16 == 15) {
beautifiedStr += '\n';
}
}
return beautifiedStr;
}
}