I have three types of strings which I need to put into single a List in a particular order. By 'three types' I mean that there are three ways of treating a string.
I thought of using a struct like this to put in the list:
struct Chunk
{
public char Type; // 'A', 'B' or 'C'.
public string Text;
}
Maybe there's a better way of marking a string with how it should be processed?
You can use an enum. This will give you Intellisense and error checking.
struct Chunk
{
public TheType Type; // 'A', 'B' or 'C'.
public string Text;
}
enum TheType { A, B, C }
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With