i have searched up several of your topics, but i can't seem to figure out how to get between multiple different characters.

Example

```
string str = "AG/B/C,BC/D,AD,AE/R/B/A,AB";

```

i want to extract between two / or two , only  

final result should be:

```
B,AD,R,B,AB

string temp;
for(int i=0; i < str.size(); i++)     
    {
        temp += str[i];                  
        if((str[i] == '/') || str[i] == ',')                   
        {
            //do something
        }
    }

```