[InlineArray(3)]
struct ThreeStringBuffer {
string _;
}
static void Test() {
var buffer = new ThreeStringBuffer();
buffer[0] = "Hello";
buffer[1] = "I'm";
buffer[2] = "Ben";
foreach (var str in buffer) {
Console.WriteLine(str); // Writes Hello / I'm / Ben across three lines on console
}
// We can also use a standard for loop if we prefer:
for (var i = 0; i < 3; ++i) {
Console.WriteLine(buffer[i]); // Identical output as above
}
}