This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
lukasloko's profile picture

Fiend a word position on a string

Started by lukasloko, 04 August 2015 - 06:44 PM
lukasloko #1
Posted 04 August 2015 - 08:44 PM
I am trying to make a code that , reads a string and find a word and the position of it then return the position..
I have no idea how I can do that, so i have no code here…but this may express what i mean:

str = "I have no idea,"
X,Y = function_that_I_am_trying_to_do(word:"no")
print(X,Y)
return:
7,1
I ill appreciate your help.
KingofGamesYami #2
Posted 04 August 2015 - 08:50 PM
Looks like you want string.find.
lukasloko #3
Posted 04 August 2015 - 08:58 PM
I think that will work thanks.