How to search for a specific string within an input string
Posted: Tue Mar 01, 2011 4:55 am
Hi
I have a input str OPT_STRING="AN3 AY1 B34 B35 C67 DG7 FE1 FE9 FQ3 IKC JB9 JL9 KG7 K05 LZ4 MX0 M15 NK5 NT7 NW9 OSH QB5 QPX UE0 UW6 U1C U19 U2E U77 VC5 VH9 VS7 V73 WD1 WD2 WD7 Z49 1SB 19C 19I 40U 6HM 7HM 8MZ 9MZ"
Now the requirement is:
IF Option code VN9 or VNL exists in the source field OPT_STRING send 'X' else send blank
Note: There is a space between any two option code in the input string i.e.
AN3 AY1, after 3 there is a space.
How to search VN9 and VNL within the input string OPT_STRING?
I have a input str OPT_STRING="AN3 AY1 B34 B35 C67 DG7 FE1 FE9 FQ3 IKC JB9 JL9 KG7 K05 LZ4 MX0 M15 NK5 NT7 NW9 OSH QB5 QPX UE0 UW6 U1C U19 U2E U77 VC5 VH9 VS7 V73 WD1 WD2 WD7 Z49 1SB 19C 19I 40U 6HM 7HM 8MZ 9MZ"
Now the requirement is:
IF Option code VN9 or VNL exists in the source field OPT_STRING send 'X' else send blank
Note: There is a space between any two option code in the input string i.e.
AN3 AY1, after 3 there is a space.
How to search VN9 and VNL within the input string OPT_STRING?