Line breaks "\n" not formatting when string is modified, is there a work around?

So basically I just used text.replace on the text values of some TMP_Text components:

        gameObject.GetComponentInChildren<TMP_Text>().text = gameObject.GetComponentInChildren<TMP_Text>().text.Replace("#", quantity.ToString());
        gameObject.GetComponentInChildren<TMP_Text>().text = gameObject.GetComponentInChildren<TMP_Text>().text.Replace("$", price.ToString());

Looking via the inspector, the text values are exactly what I want, but in the actual runtime, the string I see is “Sell 9 to
Winston’s
7”

Is there a way with Unity or Text Mesh Pro for the component to re-format the linebreak? Or is string.Replace() deprecated?

It took me this long to realize that typing enter is the equivalent of a linebreak but it still works after you use string.replace()