From 168399518411817eb2f59a1d700d6dbfdff7159d Mon Sep 17 00:00:00 2001 From: "Jim (Dimitrios) Andrakakis" Date: Tue, 30 Apr 2024 16:35:05 +0200 Subject: [PATCH] Update README.md --- README.md | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 1afa3ab..65369fb 100644 --- a/README.md +++ b/README.md @@ -288,19 +288,20 @@ Imports System.Linq Imports System.Collections.Generic Imports System.IO + Public Module Module1 Public Sub Main() Dim myXml As String = "Avocado DipSunnydalecarb2fiber1protein11" - Dim mydata - mydata = XmlSlurper.ParseText(myXml) - Console.WriteLine("Vegetable name: " & mydata.name.ToString) - Console.WriteLine("Vegetable manufacturer: " & mydata.mfr.ToString) + Dim myVegetable + myVegetable = XmlSlurper.ParseText(myXml) + Console.WriteLine("Vegetable name: " & myVegetable.name.ToString) + Console.WriteLine("Vegetable manufacturer: " & myVegetable.mfr.ToString) Console.WriteLine() - Dim list As List(Of Dandraka.Slurper.ToStringExpandoObject) = mydata.nutrientList - Dim proteinContent As Object = list.FirstOrDefault(Function(i) CType(i, Object).name = "protein") - Console.WriteLine(proteinContent.name.ToString() + " - " + proteinContent.value.ToString()) + Dim myNutrientsList As List(Of Dandraka.Slurper.ToStringExpandoObject) = myVegetable.nutrientList + Dim proteinNutrient As Object = myNutrientsList.FirstOrDefault(Function(i) CType(i, Object).name = "protein") + Console.WriteLine(proteinNutrient.name.ToString() + " - " + proteinNutrient.value.ToString()) Console.ReadLine() End Sub End Module