mardi 7 janvier 2020

How To Convert a Variable trace To String in C#

public class MyClass
{
public int Test;
public List<string> StrTest; 
}

private string ToStr()
{
// I don't know
}
void main()
{
   MyClass A = new MyClass();
   string str = ToStr(A.StrTest[20]);
   Console.WriteLine(str);
}

I want a function that for above sample code the output be a string. The list is null but Output be a string with this value "A.StrTest[20]"





Aucun commentaire:

Enregistrer un commentaire