cancel
Showing results for 
Search instead for 
Did you mean: 

How to remove leading zeros from a string

Former Member
0 Kudos

Hi,

I have a situation here where i need to remove the leading zeros from the incoming data.

i.e if 0009 then it should be taken as 9

if 0230 it should be taken as 230

Regards,

Ashish

Accepted Solutions (1)

Accepted Solutions (1)

arunneerolil
Contributor
0 Kudos

Hi

Use a user-defined (java)function .

Rgds

arunneerolil
Contributor
0 Kudos

Try this

String ss="0009";

int a = Integer.parseInt(ss);

ss = String.valueOf(a);

return ss;

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi ,

Write UDF to parse data .

String dataVal="0230";

int parseVal = Integer.parseInt(dataVal);

System.out.println("parseVal is "+parseVal);

result.addValue(parseVal); or return parseVal;

Nanda

Former Member
0 Kudos

Hi Ashish,

there is no standard function in graphical mapping.

You have to write a UDF.

Regards Mario