Re: find or equal test problem

new topic     » goto parent     » topic index » view thread      » older message » newer message

sixs wrote:
> 
> Thanks for the advice from all. I am trying to find words in  a listing 
> or letter document .

To find a substring inside a string, use the match() function.

  object textline
  integer location
  textline = gets(0)
  location = match("pickle", textline)
  if location > 0 then
     printf(1, "\nPickle was found at column %d\n", location)
  else
     puts(1, "\nNo pickles here!\n")
  end if


-- 
Derek Parnell
Melbourne, Australia
irc://irc.sorcery.net:9000/euphoria

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu