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

[REBOL] Re: [copy//part] copy/part inconsistent ?

From: greggirwin::mindspring::com at: 23-Nov-2004 21:21

Hi Peter, PWW> I'm a bit confused about the behaviour of copy/part as it appears PWW> inconsistent: PWW> >> str: "123456789" PWW> == "123456789" PWW> >> copy/part str find str "9" PWW> == "12345678" PWW> >> copy/part str index? find str "9" PWW> == "123456789" It may not be as clear as it could be from the help string, but it makes sense: /part -- Limits to a given length or position. range -- (Type: number series port pair) So, the distinction is that an integer (when you use INDEX?) specifies a length, while giving a series (the result of FIND STR "9") specifies a position (think of it as "up to" the position). -- Gregg