我做了一个控制台程序,但问题是它不允许插入参数。所以我想知道如何将单个字符串拆分为多个字符串以实现我所需要的。例如:text="msg Hello"
将被拆分为textA="msg"
和textB="Hello"
这是迄今为止的主要控制台代码(只是为了展示这个想法):
if (keyboard_check_pressed(vk_enter)) {
text_console_c = asset_get_index("scr_local_"+string(keyboard_string));
if (text_console_c > -1) {
text_console+= "> "+keyboard_string+"#";
script_execute(text_console_c);
text_console_c = -1;
}
else if (keyboard_string = "") {
text_console+= ">#";
}
else {
text_console+= "> Unknown command: "+keyboard_string+"#";
};
keyboard_string = "";
}