Hi guys i am encountering some problems.

I need to write a prog that compares a user input string with a code wode, if the code word is found, the program will return the positions of the code word found in the user input string. I manage to done part if i already fixed the code word in my prog, but somehow if i allow the user to input the code word to check for, the prog doesn't work as i have fixed the code word to 3 letters, is there a way where i can get the prog to check for any length of letters?