fluffychat/lib/utils/beautify_string_extension.dart
2021-12-03 17:29:32 +01:00

18 lines
365 B
Dart

//@dart=2.12
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;
}
}