Line break in string variable

how an i insert a line break in a string variable:
"unpaid family worker full time: female- " + (roster18[4].ft_f??0).ToString() + " male - " + (roster18[4].ft_m??0).ToString() + " transgender- " + (roster18[4].ft_tg??0).ToString() + " part time: female- " + (roster18[4].pt_f??0).ToString() + " male - " + (roster18[4].pt_m??0).ToString() + " transgender- " + (roster18[4].pt_tg??0).ToString() + " total worker- " + (roster18[4].tot_c3_8??0).ToString()

this is the expression for a string variable.
I want to insert a line break before the word part-time

Define 2 string variables.
Include the BR tag into the static text when displaying them.

1 Like

At this point, there is no way to create a variable with a special character in it (including line breaks).

By the way, you can simplify your expression by using string interpolation feature of C#:

$"female - {roster18[4].ft_f??0}; 
male - {roster18[4].ft_m??0}; 
transgender - {roster18[4].ft_tg??0}; 
part time: female - {roster18[4].pt_f??0};
male - {roster18[4].pt_m??0};
transgender - {roster18[4].pt_tg??0};
total worker - {roster18[4].tot_c3_8??0}"

Please note, that resulting string will not have line breaks. They were added to improve code readability.

Alternatively, you can create 8 variables and substitute them into a static text with HTML formatting.