cancel
Showing results for 
Search instead for 
Did you mean: 

Leading Zeros

Former Member
0 Kudos

Hi,

I have this UDF that provides leading zeros and it works but only if the source field contains only numerical data. I want it to provide leading zeros even if there are some alphabetical data in it i.e 66V01342.

My current rule is: if (myString.matches("[0-9]*"))

(I thought that "*" would do it but it doesn't.

Thanks

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

U just change the line of code as

if (myString.matches("[0-9a-zA-Z]*"))

That will suffice..

Still nt solved do post

Babu

Former Member
0 Kudos

Hi,

thanks for you reply but it didn't work and not even the numerical works now.

any more ideas?

Thanks

Former Member
0 Kudos

Hi,

I hope u r giving like this

if (myString.matches("\[0-9a-zA-Z\]*")) // [ ] are present with in the string.....

What exactly u need to check in the if condition.. can u plz give the exact requirement....

What is exactly ur UDF Requirement

Babu,

Edited by: hlbabu123 on Apr 8, 2010 2:29 PM

Edited by: hlbabu123 on Apr 8, 2010 2:31 PM

Former Member
0 Kudos

Hi,

why do you need the match function and not only check the length of the string and then add the leading zeros?

Regards

Patrick

Answers (0)