Skip to content

Commit e45101b

Browse files
committed
Added string array 2D parameter example.
1 parent 77471ab commit e45101b

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

docs/guides-basic/dotnet-native-aot-support.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -354,6 +354,37 @@ public static string NativeStringArray(string[] s)
354354
| A3 | World |
355355
| B1 | =NativeStringArray(A1:A3) | Native StringArray VALS: 12.3World
356356

357+
## String array 2D parameter
358+
359+
```csharp
360+
[ExcelFunction]
361+
public static string NativeStringArray2D(string[,] s)
362+
{
363+
string result = "";
364+
for (int i = 0; i < s.GetLength(0); i++)
365+
{
366+
for (int j = 0; j < s.GetLength(1); j++)
367+
{
368+
result += s[i, j];
369+
}
370+
371+
result += " ";
372+
}
373+
374+
return $"Native StringArray2D VALS: {result}";
375+
}
376+
```
377+
378+
| Cell | Formula | Result
379+
| ----- | ----------------------------| ------
380+
| A1 | 01 |
381+
| A2 | 2.30 |
382+
| A3 | Hello |
383+
| B1 | 5 |
384+
| B2 | 6.7 |
385+
| B3 | World |
386+
| C1 | =NativeStringArray2D(A1:B3) | Native StringArray2D VALS: 15 2.36.7 HelloWorld
387+
357388
# Not supported functionality in native add-ins
358389

359390
Loading images for ribbon controls.

0 commit comments

Comments
 (0)