Another String to Text problem

Hello Forum Runners,

What I am attempting here is to parse a CSV text file with a string array, and then taking the output depending on the index and throwing it into my Text component’s textbox. I’m sure this has been answered before, but I am just wishing there was a simple String->ToText function.

void Update(){
        if (rayHit = true){
                myText.text = GatherLines(hitLayer - 7).text;
        }
    }

    public Text GatherLines (int layer){
        var stringArray = EVlines.text.Split("'"[0]);
        return stringArray[layer];
        }

the error comes because the stringarray returns as a string

why not simply like this:

    void Update()
    {
        if (rayHit = true)
        {
                myText.text = GatherLines(hitLayer - 7);
        }
    }

    public string GatherLines (int layer)
    {
        var stringArray = EVlines.text.Split("'"[0]);
        return stringArray[layer];
    }