mirror of
https://github.com/godotengine/godot-docs.git
synced 2026-01-04 14:11:02 +03:00
[.NET] Use collection expressions
As of C# 12 we can now use collection expressions to reduce some boilerplate when initializing collections.
This commit is contained in:
@@ -212,7 +212,7 @@ to said method.
|
||||
// Outputs "Hello there!" twice, once per line.
|
||||
myGDScriptNode.Call("print_n_times", "Hello there!", 2);
|
||||
|
||||
string[] arr = new string[] { "a", "b", "c" };
|
||||
string[] arr = ["a", "b", "c"];
|
||||
// Output: "a", "b", "c" (one per line).
|
||||
myGDScriptNode.Call("print_array", arr);
|
||||
// Output: "1", "2", "3" (one per line).
|
||||
|
||||
Reference in New Issue
Block a user