fix InsertSpaceEvery24Chars

This commit is contained in:
Hepatica
2024-01-29 21:51:56 +01:00
parent 65ed89d05c
commit dead4e8c2a

View File

@@ -47,12 +47,15 @@ export default {
this.msg = ""; this.msg = "";
}, },
InsertSpaceEvery24Chars(word) { InsertSpaceEvery24Chars(text) {
let result = ""; let result = "";
for (let i = 0; i < word.length; i += 22) { for (let i = 0; i < text.length; i++) {
result += word.substring(i, i + 22) + " "; if (i > 0 && i % 24 === 0) {
result += " ";
} }
return result.trim(); result += text[i];
}
return result;
}, },
}, },
}; };