I'm trying to write a program that reads in a users input and iterates through it and finds a certain word. If that word is found, do something. Quite simple actually.
1 2 3 4 5
FOR (i; i <string; i++)
IF string contains "example"
//do something
ELSE
//do something
I was wondering how in the //do something, I could put another function that I've written BUT that would just cause my program to run that function i amount of times instead of just once. How do I get around this? Cant seem to figure it out.
Cool. That seemed to work. Another issue though. I currently have:
1 2 3 4 5 6 7 8 9 10 11
FOR (i; i <string; i++)
IF string contains "example"
FOR (i; i <string; i++)
IF string contains "2nd example"
//do something
ELSE
//do something
ELSE
//do something
Even if the example or 2nd example is found, the "ELSE" is always executed. Why?