‎2008 May 27 4:30 PM
hi, gurus,
i have a problem with a validation program for a text string S.
I want to validate that S starts with string A and ends with another string B.
Both A and B are the sets of different strings.
Is RegEX suitable for this program? Is there agile method to solve it?
Thanks,
xiongfei
‎2008 May 27 4:36 PM
‎2008 May 27 4:34 PM
Hi Welcome to SDN..
vl_total = strlen ( S ).
vl_check = vl_total - 1.
if S+0(vl_total) CS A and if S+vl_check(vl_total) CS B.
‎2008 May 27 4:36 PM
‎2008 May 27 4:37 PM
Hi Xiongfei Zhao,
First Find the lenght of the String S using command STRLEN.
STRLEN is used to find the length of the string.
For example suppose the length of the string S is 14.
to find the first charecter use the OFFSET as shown below
data: lw_first type c,
lw_last type c.
lw_first = S+0(1).
lw_last = S+9(1).Best regards,
raam