c# - How to convert chained static class names and a property value to a string? -
context: suppose 1 has following class structure:
public static class somestaticclass { public static class someinnerstaticclass { public static readonly string someproperty = "somestringvalue"; } }
question:
is there easy way convert reference somestaticclass.someinnerstaticclass.someproperty
string value of "somestaticclass.someinnerstaticclass.somestringvalue"?
the first thing posted wrong because static types wrote little code , works.
public static class { public static class b { public static string c { { return "hi"; } } } } class program { static void main( string[] args ) { console.writeline(typeof(a.b).fullname.replace("+",".") + "." + a.b.c ) ; } }
Comments
Post a Comment