in reply to substr problem
substr - get or alter a portion of a string SYNOPSIS: ========= substr EXPR,OFFSET,LEN,REPLACEMENT substr EXPR,OFFSET,LEN substr EXPR,OFFSET DESCRIPTION: ============ Extracts a substring out of EXPR and returns it. First character is at offset 0, or whatever you've set $[ to (but don't do that). If OFFSET is negative (or more precisely, less than $[ ), starts that far from the end of the string. If LEN is omitted, returns everything to the end of the string. If LEN is negative, leaves that many characters off the end of the string.So, your -1 where the OFFSET is at, is starting from the end of the string. And since you
|
---|