✅ problem
I call a function that returns something like this
How can I turn this into a Array ?
How can I turn this into a Array ?
c#
"["value 2","value 1"]"["Value 1","Value 2"] (which is valid json, a list with 2 string elements), instead of "["Value 1","Value 2"]" which is invalid json, it makes quite a differenceNewtonsoft.Json, right?string[]?string[] arr = JsonConvert.DeserializeObject<string[]>(content);item btw?" at the start and the end was just about how u displayed the contentSystem.Text.Json instead, its since .net 7 the defacto standard unless u have some niche cases regarding invalid jsonc#
mta = new MTA("5.42.223.36", 22005, "user", "pass");
MTA_LuaArgs args = new MTA_LuaArgs();
var item = mta.CallFunction("discord_bot", "getInfo", args);
await command.RespondAsync(item);["Value 1","Value 2"]"["Value 1","Value 2"]"string[] arr = JsonConvert.DeserializeObject<string[]>(content);item"local originalGetPlayerCount = getPlayerCount
function getInfo()
return getServerName() , "Player Count : "..tonumber(originalGetPlayerCount())
end