I have the following struct:
struct entry
{
public string msg;
public UInt32 ts;
public bool newLines;
public entry(string message, UInt32 timestamp, bool lines = false)
{
msg = message;
ts = timestamp;
newLines = false;
}
public override string ToString()
{
return msg + (newLines ? "\n" : "");
}
};
I am using a List of these structs in my program, in some parts of the program I need to take the list of these entry’s, and combine them back into a long string separated by newlines. My question is is my ToString() method going to work with a List<entry>? Or do I need to override another function?
Thanks
You would need to make a custom class that inherits List like this: