Get an Int by it's name C#

I am trying to find an integer that’s name is equal to the value of a string.

Essentially I want to do the following

public string engine;

private int[] e01 = new int[] {12,4,6,4};

I want to return e01[0] if string engine is equal to e01

Debug.Log (engine[0]);

How can I do this?

You can use a static helper class like this:

using System;
using System.Linq.Expressions;

public static class Names
{
    public static string GetVarName<T>(Expression<Func<T>> memberExpression)
    {
        MemberExpression expressionBody = (MemberExpression)memberExpression.Body;
        return expressionBody.Member.Name;
    }
}

//And use the class like this:

void Start () {
    int myVar = 0;
    string varName = Names.GetVarName(() => myVar); // varName = "myVar"
}