From: matt@... (Matt Neuburg) Date: 2011-09-16T02:40:53+09:00 Subject: Re: Tough Ruby Homework It might help to note that an array is an enumerable and that enumerable gives you each_slice. So if you really mean a word and the 3 words on either side of it, that's 7 words - and so if you take slices of 7 elements, you can examine each one to see if its middle item is your word. m. Rory Pascua wrote: > I'm trying to take a long piece of text, find a word, and get that word > and the 3 words on either side of it and put that new "string" into > another variable. -- matt neuburg, phd = matt@tidbits.com A fool + a tool + an autorelease pool = cool! AppleScript: the Definitive Guide - Second Edition! http://www.tidbits.com/matt/default.html#applescriptthings