- Home /
Question by
Luiz_Thiago · Dec 01, 2014 at 06:00 PM ·
ui
Line break via script in the new UI 4.6
Hello everybody, I'm trying to add line break in a string, and then assign it to a text of a label. The problem is that the label does not show the line break. What am I doing wrong?
string cost = CurrentBuilding.Building.CostDescription;
cost.Replace(",", "\n");
LabelBuildingCost.text = cost;
Comment
Best Answer
Answer by jenci1990 · Dec 01, 2014 at 06:12 PM
cost.Replace(",", "\n"); <= this return the new string.
use this:
cost = cost.Replace(",", "\n"); //"\n" new line