Convert Keyvaluepair to String

As of now, my extracted data is in form of [PONumber, 1233456].
I need to convert this to string format.

I have attached the snip of the variable type declared.

Could anyone please help me to sort it out.

image

@Anandha_Krishnan

try like this variablename(0)("PONumber").ToString

cheers

Hi @Anandha_Krishnan

Try this:

result = String.Join(", ", extractedData.Select(Function(pair) $"{pair.Key}: {pair.Value}"))

image

I have tried but this was the error message now faced

image

Tried this method too but this is the output

@Anandha_Krishnan

remove (0) …as per intial one you have shown ienum but we dont see it here…so remove it should work

cheers

@Anandha_Krishnan
we cannot derive all details and values from above. But find some samples as an introduction to the main building blocks, demonstrated on a KVP Collection with 2 items:

grafik

And finally also a conversion to a dictionary:
grafik

Hi @Anandha_Krishnan

Try this:

String.Join(Environment.NewLine, MyDict.Select(Function(keyvalue) keyvalue.Key & ": " & keyvalue.Value))

Hope it will helps you :slight_smile:
Cheers!!

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.