What I'd like to be able to do is have a struct return a variable without having to specify it by it's property. I'm probably phrasing this question incorrectly so I'll give an example (this fails of course). Apologies for any confusion or inconsistancies but this is what I'd like to achieve and not sure how to do this or even go about searching for it.
struct theString{
public string my_String;
}
theString myString = new theString();
string currentMethod = myString.my_String;
string how_I_would_like_it = myString;
Thanks in advance for any/all help.
[edit] The property string is just for the example. You can replace string with anything you'd prefer, be it int, object, webhttprequest, etc...
The problem is that when I do the string how_I_would_like_it = myString; It won't assign the my_String variable to how_I_would_like_it and the cannot implicitly convert error.
string how-I-would-like-it = myStringthat you're asking for an implicit conversion from your struct typetheStringtostring. If that's the case, why not just specifyToString()?