Line wrapping inside the text box

I’m trying to add line breaks to text, but UXP doesn’t accept
or “\n"Does anyone have a solution? `function formatDaysArray(daysArray) {
const daysOfWeek = [“D”, “S”, “T”, “Q”, “Q”, “S”, “S”];
let formattedText = daysOfWeek.join(” ") + “\n”; // Adiciona cabeçalho dos dias da semana

let currentLine = "";

daysArray.forEach((day, index) => {
    currentLine += day.toString().padStart(2, ' ') + " ";
    if ((index + 1) % 7 === 0) {
        formattedText += currentLine.trimEnd() + "\n";
        currentLine = "";
    }
});

if (currentLine.trim()) {
    formattedText += currentLine.trimEnd() + "\n"; // Adiciona a última linha, se houver
}

return formattedText.trim();

}`

I remember that line breaks were unified in Photoshop strings with \r. Would it work if changed to \r?

Thanks! I had already taken the test shortly after posting. In any case, thank you for your attention.

1 Like