Home > Software engineering >  Convert a single element list to a string
Convert a single element list to a string

Time:08-30

I have a list with just one value

"list": [
            "abcdef0000001"
        ]

which I need to convert to a string, to be like:

"var": "abcdef0000001"

Is there an easy way to do it? I couldn't find it.

I tried converting with | string but that didn't help.

CodePudding user response:

You can directly assign "var" = list[0]

Hope this should work for you

  • Related