cancel
Showing results for 
Search instead for 
Did you mean: 

Stripping-off the leading zeros

Former Member
0 Kudos

Hi Experts,

I have a mapping requirement in which I need to map a source field with a target field in which I need to strip off the leading say 4 zeros from the target field. Now, can this be done with standard PI functions available or we need an UDF for this functionality.

Please let me know.

Regards,

Aniruddha

Accepted Solutions (1)

Accepted Solutions (1)

former_member182503
Active Contributor
0 Kudos

Hi Aniruddha,

You can do it with the standard function formatNumber.

Also, you can write a custom UDF with the following code:

String ret = a.replaceFirst("^0+","");
return ret;

Best regards,

JN

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Jose,

I will try out the UDF as well.

Thanks for your help once again.

Regards,

Aniruddha

Former Member
0 Kudos

Hi Jose,

Thanks a lot for your help again, I was trying a UDF as an option.

Regards,

Aniruddha