See example here:
C# Class get returning two dimensional array - Stack Overflow[
^]
But see the warning here:
CA1819: Properties should not return arrays (code analysis) - .NET | Microsoft Docs[
^]
And here is a simple example (although returning arrays this way is not really recommended either):
var test = new Test();
var arr = test.TestArray();
Debug.Print(arr[0, 0]);
Debug.Print("arr.Length = " + arr.Length);
public class Test
{
public string[,] TestArray()
{
string[,] testArr = new string[5, 5];
testArr[0, 0] = "0,0 test";
return testArr;
}
}