I have a program which reads commands from a text file
for example, the command syntax will be as follows and is a string
'index command param1 param2 param3'
The number of parameters is variable from 0 up to 3
index is an integer
command is a string
all the params are integers
I would like to split them so that I have a list as follows
[index,'command',params[]]
What is the best way to do this?
Thanks
Not sure if it’s the best way, but here’s one way:
Result will contain