I have a string like
string = ionworldionfriendsionPeople
How can I split it and store in to array based on the pattern ion as
array[0]=ionworld
array[1]=ionfriends
array[2]=ionPeople
I tried IFS but I am unable to split correctly. Can any one help on this.
Edit: I tried
test=ionworldionfriendsionPeople
IFS='ion' read -ra array <<< "$test"
Also my string may sometimes contains spaces like
string = ionwo rldionfri endsionPeo ple