cancel
Showing results for 
Search instead for 
Did you mean: 

Simple UDF to remove first digit from field

Former Member
0 Kudos

Hi,

unfortunately my searching for a solution was not successful.

I need a UDF to remove the first digit from a field in mapping ! 

The problem:

The field content length can vary from time to time, so a simple substring does not work.

So e.g. from 1029374   to Z56373 5583645908d374 anything is possible!

And I need to get rid of the first digit always.

Thank you for your help!

Best regards

Dirk

Accepted Solutions (1)

Accepted Solutions (1)

former_member182412
Active Contributor
0 Kudos

Hi Meinhard,

Use below UDF:

Execution Type: Single Values

Argument : str


public String removeFirst(String str, Container container) throws StreamTransformationException{

return str.substring(1);

}

Test:

Regards,

Praveen.

Former Member
0 Kudos

Hi Praveen,

Thank you very much!

Best regards

Dirk

Answers (0)