How can I have a string be a part of a directory/data path?

Here is my code I’m doing a test with :

var numbercurrentobj;
var newnumber1;

function Start () {

numbercurrentobj = "456245";

}

function Update ()  {

    var readerObjcurrentobj = File.OpenRead(Application.dataPath+"/Resources/currentobj/" +"currentobj.txt");
    reader = new StreamReader(readerObjcurrentobj);
    var infocurrentobj : String = reader.ReadToEnd();
    levelInfocurrentobj = infocurrentobj.Split("

"[0]);
newnumber1 = levelInfocurrentobj[0];
reader.Close();

   if (newnumber1 == "1"){
{     
   Debug.Log ("number is 1", gameObject);

         }       
   }

}

My question is this - is there a way to have the string (numbercurrentobj) be part of the data path?

In pseudo code, I was hoping for something like this :

var readerObjcurrentobj = File.OpenRead(Application.dataPath+"/Resources/currentobj/"numbercurrentobj +"currentobj.txt")

It should work so that it opens Resources>currentobj>(folder with same name as string)>text file.

Is there a way to do this? Specifically, what would I need to type instead of that one line of pseudo code?

This should do the trick I think :

#pragma strict

import System.IO;

var numbercurrentobj;
var newnumber1;

var path : String = "\\Resources\\currentobj\\";

var currentobj : String;

function Start () {

	numbercurrentobj = "456245";

}

function Update ()  {

	var readerObjcurrentobj = File.OpenRead(Application.dataPath + path + numbercurrentobj + "\\currentobj.txt");
	var reader : StreamReader = new StreamReader(readerObjcurrentobj);
	var infocurrentobj : String = reader.ReadToEnd();
	var levelInfocurrentobj : String[] = infocurrentobj.Split("

"[0]);
var newnumber1 : String= levelInfocurrentobj[0];
reader.Close();

	if (newnumber1 == "1") Debug.Log ("number is 1", gameObject);
       
}

I’ve set up a simple scene for you so you can test it, just import the package in an empty project.