Subject: Re: Why Doesn't Substing Work From: "W. Eliot Kimber" <eliot@xxxxxxxxxx> Date: Thu, 02 Apr 1998 11:18:28 -0600 |
At 11:45 AM 4/2/98 -0500, Tony Graham wrote: >At 1 Apr 1998 15:58 -0600, W. Eliot Kimber wrote: > > I just realized that the second argument is not a length but the character > > that is the last character of the substring. Too many years of Rexx and > > Perl programming. > >Something's wrong somewhere. Section 8.5.9.7 of the DSSSL standard >says: > > (substring string start end) > > Returns a string formed from the characters of "string" beginning > with index "start" (inclusive) and ending with index "end" > (exclusive). > >The arguments to substring should be a string, a number, and a number. Right, but the second number is an index, not a length. Thus: (substring str 0 1) -> First character in string (substring str 1 1) -> Error, second argument out of range (substring str 1 2) -> second character in string (substring str 1 (string-length str)) -> All but first character of string Cheers, E. -- <Address HyTime=bibloc> W. Eliot Kimber, Senior Consulting SGML Engineer Highland Consulting, a division of ISOGEN International Corp. 2200 N. Lamar St., Suite 230, Dallas, TX 95202. 214.953.0004 www.isogen.com </Address> DSSSList info and archive: http://www.mulberrytech.com/dsssl/dssslist
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: Why Doesn't Substing Work, Tony Graham | Thread | Re: Why Doesn't Substing Work, Tony Graham |
Re: Tables on two or more pages, Tony Graham | Date | Re: Why Doesn't Substing Work, Tony Graham |
Month |