Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

find a specific character in an input string and getting the string after if

Hello,

my requirement is as such, lets say we have an input string ABHISHEK #1234, or BOMBAY 123 #235,

i need to find if the character string has # in it,, if yes pick all the numbers after # .

in the above example, i need output as 1234 and 235

and if any non numeric values after # set a flag

please help me in this.

regards

Abhishek

Former Member
Former Member replied

Hi Abhishek,

$GV_VALUE  -- Is your String value

Index function can be used to identify #  in string

decode(index($GV_VALUE,'#',1)>0,substr( $GV_VALUE ,index($GV_VALUE,'#',1)+1,length($GV_VALUE)- index($GV_VALUE,'#',1)+1),$GV_VALUE)

1 View this answer in context

Helpful Answer

by
Not what you were looking for? View more on this topic or Ask a question