Skip to Content
0
Former Member
Apr 22, 2009 at 07:25 AM

Removing leading zeros and leading blank spaces from an input field

1227 Views

Hi All,

I have an input field which is alphanumeric and i need to remove the leading zeros and blank spaces in it , but intermediate spaces should be kept .

so i used the UDF

String output = input.replaceFirst("^0+","");

return output;

but this code does not remove the leading blank spaces . Can anybody help in modifying this code so that even the leading blank spaces along with leading zeros can be removed .

Regards ,

Loveena .