I have a string like this :- ‘18-25’!C11 + ‘18-25’!C57 - ‘18-25’!C86
The specific part of the string is separated by + or - … Here we can have any number of separators here which is + or -.
I have to extract the string on the basis or + or - and add that part in an array and collection and will loop through array
for ex:- for string ‘18-25’!C11+‘18-25’!C57-‘18-25’!C86
I get 3 extracted strings which is :- ‘18-25’!C11 , ‘18-25’!C57 and 18-25’!C86
Now I have to add these strings in an array or collection.so that the first item will be to loop through is ‘18-25’!C11 , second will be ‘18-25’!C57 and the third will be 18-25’!C86.
Here the main string will be of any length, here in this case I get 3 sub - strings but it can be more also.
Hey I have checked it and its working absolutely fine , but in my case the main string can change a little bit so if you can give me solution on that then it will be a dynamic solution for me.
Like my string can be like this too :- schedule!C11+CFS!C57-karan!C86+verse!C86
I mean the say the string before “!” can change which is schedule in this case schedule!C11
and was ‘18-25’ in earlier case - ‘18-25’!C11+‘18-25’!C57-‘18-25’!C86
your solution works absolutely fine in this case but can you make it more dynamic s0 that it should work in second case too