How to change each text in a placeholder

In my scene, there are one InputField and 3 buttons.
There is text in a placeholder of the InputField: Hint1 / Hint2 / Hint3.
And names of each button are Hint1Btn, Hint2Btn, Hint3Btn.

What I want to do is:

Click Hint1Btn → text in placeholder change to pink / Hint2 / Hint3
Click Hint2Btn → text in placeholder change to Hint1 / 4 / Hint3
Click Hint3Btn → text in placeholder change to Hint1 / Hint2 / male

This is what I’ve written until now.
First , I split the text of the placeholder into 3 parts.
And I made a function that gives events to each button that make them able to change the text.

    public InputField hintField;
    string[] split_hintText;

    void Start()
    {
       split_hintText = hintField.placeholder.GetComponent<Text>().text.Split('/');

       for(int i = 0; i < split_hintText.Length; i++)
        {
            print(split_hintText[i]);
        }

    }

    public void ShowHint()
    {
        string hintBtnName = EventSystem.current.currentSelectedGameObject.name;

        if(hintBtnName == "Hint1Btn")
        {
            split_hintText[0] = "pink";
        }
        if(hintBtnName == "Hint2Btn")
        {
            split_hintText[1] = "4";
        }
        if(hintBtnName == "Hint3Btn")
        {
            split_hintText[2] = "male";
        }



    }

But the text in the placeholder doesn’t change at all when I click each button.
The code itself has no error. I think the logic has problems.

I assume that
split_hintText[0] = “pink”;
split_hintText[1] = “4”;
split_hintText[2] = “male”;
those codes just change strings of the ‘string[ ] split_hintText’ array and they don’t apply to the text of the placeholder. (like “Hint1” → “pink” and the end)

What should I do? I am stuck with this problem.

You are correct. split_hintText is an array of strings. When you call
split_hintText = hintField.placeholder.GetComponent<Text>().text.Split('/');
you are not actually referencing the Text component of those fields, instead, you are just copying the values from the Split() function into your array. To fix this, I would do the following:

  1. Create a variable that’s referencing the text component only.
    private Text hintText;

  2. In the start, set its value:

hintText = hintField.placeholder.GetComponent<Text>();
split_hintText = hintText.text.Split('/');
  1. Whenever you want to actually change the value on your object, call it by setting the hint text.text value.
if(hintBtnName == "Hint1Btn")
{
   split_hintText[0] = "pink"; 
   hintText.text = split_hintText[0];
}

Notes:
You might not even need the split_hintText array, but that’s up to you to decide in the future.
Also, look up how to use [SerializeField] private instead of public if your only goal is to expose a variable in the inspector. It will save you from a lot of trouble in the future.