I have created a string:
userId = print('{\n "userId": "1111111111abc",\n "Message": null,\n "Time": null"\n}')
Output:
{
"userId": "1111111111abc",
"Message": null,
"Time": null"
}
Now I want to "work" with this string. I want to access/extract the value of UserId - 1111111111abc. But when I start to remove the first and last n characters it says:
userId[3:]
TypeError: 'NoneType' object is not subscriptable
Why I need this? I will get 100+ JSON style strings/texts(?) and will have to extract UserId from it.
UPDATED
Pardon, but I can not find a solution to my question here. If someone can go through my example and then extract the desired ID I would be happy. If it is possible of course.