|
From: Petr M. <mi...@ph...> - 2005-07-07 12:18:16
|
> I don't know either. Perhaps I should just remove the substr() > function altogether. That would make a clear distinction between > the operation STRING[beg:end] (uses C-language indexing from 0) > and the function calls like word(STRING,N) (uses rexx or fortran > indexing starting from 1). > > But I agree that the substr(beg,end) indexing is confusing, and > contradicts the awk equivalent substr(beg,length) regardless > of whether beg starts at 0 or 1. > > Petr: What are your thoughts? It was your suggestion to include > a subroutine form of the substring operator (and it was utterly > trivial to implement). But it may add more confusion than it is > worth. I propose the substr() be compatible to awk (i.e. indexing from 1 and with parameter giving length of the substring). --- PM |