From: Colin Bartlett Date: 2010-07-12T01:58:07+09:00 Subject: Re: What is meant by those lines of code in this script? --0016e6585ed4dc77b6048b1f89ae Content-Type: text/plain; charset=ISO-8859-1 On Sun, Jul 11, 2010 at 5:26 PM, Abder-rahman Ali < abder.rahman.ali@gmail.com> wrote: > Hi, > > Regarding this part: > > sentence[open..close] = '' if close > > You explained what it means, but I just want to ask, what is ---> if > close? > You can modify a statment with "if" or "unless". A short *almost* (but not quite) accurate statement is that it is a shorthand way of writing: if close sentence[open..close] = '' end # or if close then sentence[open..close] = '' end There's a fuller explanation here: http://ruby-doc.org/docs/ProgrammingRuby/html/tut_expressions.html at "If and Unless Modifiers" You can also use "while" and "until" as statement modifiers(see Loops further down that page), but there is, as Programming Ruby says, a "wrinkle": "There's one wrinkle when while and until are used as statement modifiers. If the statement they are modifying is a begin/end block, the code in the block will always execute at least one time, regardless of the value of the boolean expression." --0016e6585ed4dc77b6048b1f89ae--