I want to split a string on different characters and I want to know what the ‘splitter’ is.
The String can be for example:
"address=test"
"number>20"
"age<=55"
In these cases I want to get the name, the seperator and the value in an array.
array[0]='address';
array[1]='=';
array[2]='test';
The separators are =,==,!=,<,>,>=,<=.
Can anyone tell me to deal with this?
Outputs:
Edit: This method using the [^=!<>] makes the method to prefer failing completely over giving unexpected results. Meaning that
foo=bar<3will fail to be recognized. This can of course be changed to fit your needs :-).