This answer goes the normal Unity way and disregards that you use the 3rd party Dialoguer system. It might provide a better way to do this or might even conflict with this method, but please forgive me that I won't pay $30 just to better answer this one question. But I noticed that the marketing bullet points for it mentions an "integrated variable system" which might help you to do what you want to do.
The text of an UI Text component is stored in the property text
. Its value is a string
, which is one of the basic classes of the C# language, so we need to head to the Microsoft Developers Network to read its documentation. There we find the method Replace(string oldValue, string newValue)
, which "Returns a new string in which all occurrences of a specified string in the current instance are replaced with another specified string". So all you need to do in your script is get a reference to your Text UI element and then do:
textUIElmenent.text = textUiElement.text.Replace("oldString", "newString");