I have the String Array.The array contains following.
- String [] Array= {"Age18" ,"Ram","Raj" ,"Sonu","Mano","Age20","Ana","Einstein","Somu"};
Now here I want to separate the String between Age 18 and Age 20.
- foreach (string line in Array)
- {
- if (line.Contains("Age18"))
- {
- //Want to print the Elements of an array before Age20.
- //result [] array={"Age18" ,"Ram","Raj" ,"Sonu","Mano"};
- }
Help me to solve this.