I have a list of strings which includes strings in format: xx@yy
xx = feature name
yy = project name
Basically, I want to split these strings at @ and store the xx part in one string array and the yy part in another to do further operations.
string[] featureNames = all xx here
string[] projectNames = all yy here
I am able to split the strings using the split method (string.split(‘@’)) in a foreach or for loop in C# but I can’t store two parts separately in two different string arrays (not necessarily array but a list would also work as that can be converted to array later on).
The main problem is to determine two parts of a string after split and then appends them to string array separately.
This is one simple approach:
The above instantiates a list of
xxand and a list ofyy, loops through the list of strings and for each one splits it. It then adds the results of the split to the previously instantiated lists.