const chunks: string[] = [];
let remaining = cleaned;
while (remaining.length > limit) { // Find the last space before the limit const window = remaining.slice(0, limit); const lastSpaceIndex = window.lastIndexOf(" ");
if (lastSpaceIndex === -1) { // No space found, hard split at limit
chunks.push(window);
remaining = remaining.slice(limit);
} else { // Split at the last space
chunks.push(window.slice(0, lastSpaceIndex));
remaining = remaining.slice(lastSpaceIndex + 1);
}
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.