How can I format a typecasting function in my custom class so that when I pass it off as another parameter type, say string, it uses the function to return an instance of the new type? I’m guessing it is something like
static public string…something something?
Edit:
The custom class is essentially a string holder, with a name and other flags
public class Datum
{
public string name;
public string value;
public string type;
this has a few unnecessary variables omitted.
It would be great if I could use simplified code to do things like the following:
Datum datumExample = “null”; // Every variable is initialized to the string “null”
// or
void aFunction(Datum a = "null"){};
aFunction();
// or
void aFunction(string a = "null"){};
aFunction(datumExample); // Where datumExample automatically returns it's
// .value variable