Closed frankcollins3 closed 11 months ago
👍 string pokemonType = data2["types"]?[0]?["type"]?["name"]?.ToString(); [11:00am]
👍{pokemonType} right here works when concatenated
Console.Write("pokemonType: \t" + pokemonType + " empty \n");
iterm2 logs:
pokemonType: grass empty
👎 {pokemonType} the logging of same above variable that works when concatenated did not work without .concat() Console.WriteLine("type: \t", pokemonType);
iterm2 logs:
type:
[11:25am]
adding % to the string makes it work
part of that above problem is trying to use the arguments how JS uses console.log() this created the need for format strings
attempting to do: 👍 data2.sprites.front_default 👍 data2["sprites"]["front_default"].ToString(); 👍 data2.types[0].type.name 👎 data2["types"][0]["type"]["name"].ToString();
error: this line of code in Index.cshtml.cs causes the error:
error CS1012: Too many characters in character literal [/Users/chasethrillz/Desktop/aspokedex/aspokedex.csproj] proposed approach: in .net it seems dot notation, in the context of a foreach loop within a code-behind file, is done like this: JS: data2.sprites.front_default