So I have the following string:
deptid = 33 AND location = 'NewYork'
basically I am trying to parse it into tokens. I have been just using Split.string and separating by space and that would work for everything I need however there are cases where the string might be:
deptid = 33 AND location = 'New York'
I need to keep everything between the quotes the way it is. Is there a way I can use String.split to split it in such a way it will split everything by space except when it encounters quote it will give me the token of everything between the quotes?
EDIT: Sorry for not clarifying earlier! But I want every single thing in that sentence. I want deptid, =, 33, AND, location,=,New York. The AND statement will not always be there. It could just be
location = 'New York'
=, except that if the word is quoted then the quotes need to be removed?