If you want the position of the first non-blank character then use WordIndex(string, 1). If you want the character itself then use Left(Word(string, 1), 1). Obviously you should include checks to handle the lack of any non-blank characters.
- mb IBM Mainframe Assembler List <[email protected]> wrote on 02/28/2018 11:32:33 AM: > From: Andre Schoeman <[email protected]> > To: [email protected] > Date: 02/28/2018 11:32 AM > Subject: FIND or INDEX builtin function > Sent by: IBM Mainframe Assembler List <[email protected]> > > Is there a way to use the inverse of either the FIND or INDEX functions ?? > > For example, a string of characters contains leading blanks and I want to find > the 1st non-blank character in that string. > > Trying "INDEX('string',NOT ' ')" or "INDEX(NOT 'string',' ')" yields > assembly errors. > (I've tried both the logical-expression and function-invocation > formats of the > INDEX and FIND functions) > > Has anyone else successfully used such inverse formats of any of > these functions, > or is there another function (that I can't see) that can yield the > results I'm after. > > Best regards, Andre >
