Question
Accenture
IN
Last activity: 10 Jan 2018 10:02 EST
How to remove Alphabets from Alphanumeric String ???
How to convert a Alphanumeric Input into a Numeric Output in Pega ? Is there any inbuilt OOTB Function in Pega that could be used in Property-Set ?
For Example, If Param.Input= "ABC123456789", then output should be "123456789".
Important Note*** : We don't have Standard pattern** here. Sometimes, the input might be "A12354987" or "AB123456789". So we cant use Substring function as well. :(
Please help , if you guys have any idea, please suggest.. how to convert a alphanumeric value into a numeric value ?
-
Likes (1)
Amila Nuvan Perera -
Share this page Facebook Twitter LinkedIn Email Copying... Copied!
Pegasystems Inc.
US
Hi Rama,
I just tried a sample code using the java replace all function with regular expression as follows,
EPAM Systems, Inc.
ES
Hi Rama,
Thanks for posting on PSC.
There isn't any OOTB rules available to get your work done,
Follow the below steps:-
1. Create a custom Edit Input rule, say "NumbersOnly".
Add code:-
2. On Advanced Tab of your property which you want to manipulate, add above created Edit Input rule.
Hope it answers your query, kindly notify by marking this post as answered.
Regards,
Asif
Accenture
IN
Hello Mahesh,
The output is same as the Input. :( . Tried other alternatives too.
JPMorgan Chase & Company
US
Hi Ram,
The below code is working fine, compile and run to see the output.
Pegasystems Inc.
US
Rama doesn't have the decimal points in his string Sudhakar, so dot(.) need to be removed in the regular expression which can be seen in my code.
Pegasystems Inc.
US
I had tested the above code in eclipse and it gave me the expected result Rama.
-
vijay raghava
EPAM Systems, Inc.
ES
Hi Rama,
Try using Edit Input rule as suggested in the previous comment. I am able to get the output correctly.