Hello everyone
As the topic suggests, I’m trying to extract data from a string. The string looks like this:
{“data1”, “data2”, “data3”, “data4”, “data5” ,“data6”}\n
From this sample, I would like to extract “data3” and “data4” and put them into 2 int respectively (the \n is a new line character).
The content and length for each “data slots” is dynamic, which means I cannot extract them by locating the positions of these data in the string. Please be noted that I have no control on the format of the string.
I believe using regular expression can solve the problem, but I have absolute zero knowledge about it. So I would like to ask for any ideas that can do the work.
Hey Aeronaut, thank you for your answer, that piece of code work perfectly fine!
But I would like to ask one more question, why wouldn’t it be working if I also trim these 2 characters:'"', ' '
in