Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

[REBOL] Search string x for any substring found in block y.

From: louisaturk::coxinet::net at: 10-Dec-2001 16:22

Rebol friends, Why won't the following function work? Is there a better way to do this? Is there a native rebol function for this that I have missed? Louis x: "There is a dog in the barn." y: ["pig" "dog" "skunk"] findany: func [ "Searches string x for any substring found in block y." x [string!] "string" y [block!] "block of substrings" ] [ count: 1 loop length? y [ if find x y/count [true break] count: count + 1 ] ] if findany x y [print found]