I have a string that I need to be split into 2. I want to do this by splitting at exactly the third comma.
How do I do this?
Edit
A sample string is :
from:09/26/2011,type:all,to:09/26/2011,field1:emp_id,option1:=,text:1234
The string will keep the same format – I want everything before field in a string.
If you’re simply interested in splitting the string at the index of the third comma, I’d probably do something like this:
Output:
Related question: