Convert String to variable contained in string
- From: gmccallum <gmccallum@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Thu, 14 Apr 2005 11:11:02 -0700
I have a situation where I have the name of a variable in a string and would
like to get the value of the variable.
Simple Example:
string varName = "MyClass.intvalue";
would like to get value of MyClass.intvalue.
I tried
int ret = Int32.Parse(varName);
but this fails because it sees that the string doesn't contain a number.
-Gregory McCallum
.
- Follow-Ups:
- Re: Convert String to variable contained in string
- From: Nicholas Paldino [.NET/C# MVP]
- RE: Convert String to variable contained in string
- From: gmccallum
- Re: Convert String to variable contained in string
- Prev by Date: Re: How to clone a class library to a new one?
- Next by Date: Re: How to clone a class library to a new one?
- Previous by thread: Re: Beta 2 Release Date? When?
- Next by thread: RE: Convert String to variable contained in string
- Index(es):
Relevant Pages
|