I have a string
first=abc123,second=status,z=3,a=45745 and want to get an output
I could try to split it into multiple arrays and the get the values OR put this string into an ArrayList and split to get the result, but wanted to check if somebody already has a solution which does not involve a lot array creation or manipulation. Like a regex which could be helpful.
This will work. However, to make it better is there some constraints to the characters after or before the = sign?
This will only check if there is only letters at the start of the equals sign then letters/numbers after that and ignore the , all together. If it doesn’t meet those requirements it will fail.
If you know there is never going to be a number = to something i would suggest thing answer.
NOTE: Everything you will need will be captured in what regex’s calls a capture group which is denoted by ().