Splitting string Array and put into another array

I have an array called allcourses which contains elements Like : " ssds*fgg*vcv* , saAds*cvb*bcfvb* , .... } and I want to split it with the "* " and put each word into another array

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
  int LL=0,NN=0;

for(int i = 0;i<allcourses[NN].length(); i++){
	
	if(allcourses[NN][i] != '&') 
	{ eachalone[LL] += allcourses[NN][i]; }

	
	else 
	{LL++;}
	
	if(LL>=3)
	{	NN++; 
	i=0;
	
}
}



It's only working for first element any help ?
Topic archived. No new replies allowed.