how to get text property of textmeshpro text field unity code example
Example 1: unity replace a text in a string
public string strOne = "Hello World";
public string strTwo = "World";
public void ReplaceStrTwoFromStrOne()
{
strOne = strOne.Replace(strTwo, "everyone");
}
Example 2: change the text of inputfield unity
using UnityEngine.UI;
public InputField example;
public string textToPutToInputField = "If I helped you don't forget to upvote!";
public void SetTheText()
{
example.text = textToPutToInputField;
}