summaryrefslogtreecommitdiffstats
path: root/doc/classes/Dictionary.xml
diff options
context:
space:
mode:
authorDubhghlas McLaughlin <103212704+mcdubhghlas@users.noreply.github.com>2024-10-16 12:19:12 -0500
committerDubhghlas McLaughlin <103212704+mcdubhghlas@users.noreply.github.com>2024-10-16 12:49:46 -0500
commita03e02442ff75b5586047ea0a88c12bff544805d (patch)
treea3b097fa6dd7a9a1bc2127f93228f457568bcfe1 /doc/classes/Dictionary.xml
parent19fb23dbeab06cde119674d18f0303f58c4acdde (diff)
downloadredot-engine-a03e02442ff75b5586047ea0a88c12bff544805d.tar.gz
Rebranding: Doc/
Diffstat (limited to 'doc/classes/Dictionary.xml')
-rw-r--r--doc/classes/Dictionary.xml10
1 files changed, 5 insertions, 5 deletions
diff --git a/doc/classes/Dictionary.xml b/doc/classes/Dictionary.xml
index 5c9b22fe4a..a94abda0cb 100644
--- a/doc/classes/Dictionary.xml
+++ b/doc/classes/Dictionary.xml
@@ -266,29 +266,29 @@
[codeblocks]
[gdscript]
var my_dict = {
- "Godot" : 4,
+ "Redot" : 4,
210 : null,
}
- print(my_dict.has("Godot")) # Prints true
+ print(my_dict.has("Redot")) # Prints true
print(my_dict.has(210)) # Prints true
print(my_dict.has(4)) # Prints false
[/gdscript]
[csharp]
var myDict = new Godot.Collections.Dictionary
{
- { "Godot", 4 },
+ { "Redot", 4 },
{ 210, default },
};
- GD.Print(myDict.ContainsKey("Godot")); // Prints true
+ GD.Print(myDict.ContainsKey("Redot")); // Prints true
GD.Print(myDict.ContainsKey(210)); // Prints true
GD.Print(myDict.ContainsKey(4)); // Prints false
[/csharp]
[/codeblocks]
In GDScript, this is equivalent to the [code]in[/code] operator:
[codeblock]
- if "Godot" in {"Godot": 4}:
+ if "Redot" in {"Redot": 4}:
print("The key is here!") # Will be printed.
[/codeblock]
[b]Note:[/b] This method returns [code]true[/code] as long as the [param key] exists, even if its corresponding value is [code]null[/code].