mirror of
https://github.com/godotengine/godot.git
synced 2026-01-03 18:11:19 +03:00
[.NET] Use collection expressions in docs
As of C# 12 we can now use collection expressions to reduce some boilerplate when initializing collections.
This commit is contained in:
@@ -546,7 +546,7 @@
|
||||
print("---".join(fruits)) # Prints "Apple---Orange---Pear---Kiwi"
|
||||
[/gdscript]
|
||||
[csharp]
|
||||
var fruits = new string[] {"Apple", "Orange", "Pear", "Kiwi"};
|
||||
string[] fruits = ["Apple", "Orange", "Pear", "Kiwi"];
|
||||
|
||||
// In C#, this method is static.
|
||||
GD.Print(string.Join(", ", fruits)); // Prints "Apple, Orange, Pear, Kiwi"
|
||||
|
||||
Reference in New Issue
Block a user