Jump to content




Fiend a word position on a string

help

  • You cannot reply to this topic
2 replies to this topic

#1 lukasloko

  • Members
  • 28 posts
  • Location<Insert a location joke here>

Posted 04 August 2015 - 07: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.

#2 KingofGamesYami

  • Members
  • 3,002 posts
  • LocationUnited States of America

Posted 04 August 2015 - 07:50 PM

Looks like you want string.find.

#3 lukasloko

  • Members
  • 28 posts
  • Location<Insert a location joke here>

Posted 04 August 2015 - 07:58 PM

I think that will work thanks.





2 user(s) are reading this topic

0 members, 2 guests, 0 anonymous users