0

I'm trying to delete only the first zero from the values of a field which now are: 00,01,02,03 etc and I'm using this function: string_trim['0', begin]. The problem with it is that it works for all the values but not for 00, since it removes everything and in the results I receive a NULL value. Is there any other option in order to remove only the first zero?

Thank you.

2 Answers2

0

Although You did not mention it in which programming language you are asking php or mysql.But below is the hint for your issue.

Split this string into array by comma ( , ). loop through each array and remove first zero ( right(1) or trim(STRing , '0') ) Then merge array into string by comma separated.

Krishan Kumar
  • 394
  • 4
  • 13
0

For DataStage this would be a solution for a Transformer stage

IF left(field,1) = "0"
THEN  file[2,len(field) - 1)]
ELSE field
MichaelTiefenbacher
  • 3,805
  • 2
  • 11
  • 17