From 1f32b229371e43045459f642d832b7e52fc73264 Mon Sep 17 00:00:00 2001 From: fulanko Date: Sun, 21 Apr 2024 17:49:44 +0200 Subject: [PATCH] Fix incorrect c# in OS.get_cmdline_args --- doc/classes/OS.xml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/doc/classes/OS.xml b/doc/classes/OS.xml index a130b06dba2..7c69bc6ed20 100644 --- a/doc/classes/OS.xml +++ b/doc/classes/OS.xml @@ -189,26 +189,26 @@ for argument in OS.get_cmdline_args(): if argument.contains("="): var key_value = argument.split("=") - arguments[key_value[0].lstrip("--")] = key_value[1] + arguments[key_value[0].trim_prefix("--")] = key_value[1] else: # Options without an argument will be present in the dictionary, # with the value set to an empty string. - arguments[argument.lstrip("--")] = "" + arguments[argument.trim_prefix("--")] = "" [/gdscript] [csharp] - var arguments = new Godot.Collections.Dictionary(); + var arguments = new Dictionary<string, string>(); foreach (var argument in OS.GetCmdlineArgs()) { if (argument.Contains('=')) { string[] keyValue = argument.Split("="); - arguments[keyValue[0].LStrip("--")] = keyValue[1]; + arguments[keyValue[0].TrimPrefix("--")] = keyValue[1]; } else { // Options without an argument will be present in the dictionary, // with the value set to an empty string. - arguments[keyValue[0].LStrip("--")] = ""; + arguments[argument.TrimPrefix("--")] = ""; } } [/csharp]