Skip to main content
April 27, 2021
Question

how to remove leading zero from a string

  • April 27, 2021
  • 5 replies
  • 0 views

Hi there,

kind new to Appian, just want to know how to remove the leading zero from a string in Expression rule.

thanks,

5 replies

adityap0004
April 27, 2021

linp0001 please try this may be solve your problem.

1)Syntax : --

text( value, format )

2) Syntax : -- 

split ( text, separator )

For more details please refer this documentation --> text() Function - Appian 21.1

split function --> split() Function - Appian 21.1

linp0001Author
April 27, 2021

thanks for the information, the problem is that the number of leading 0 is variant. so it probably will not work.

regards,

April 27, 2021

Hi Lin,

Please try this plugin -regexreplaceall . Thus will help you for this specific case and also many other use cases related to formatting text using regex. Refer the link for downloading the plugin.

regexreplaceall("^0+","0000100","")

https://community.appian.com/b/appmarket/posts/regular-expression-functions

hope this helps. Have  a good Day!

csteward
April 27, 2021

Also, in case anyone is looking for an OOTB solution here - the fixed() function will do this easily for you.

tointeger(
  fixed(00002803,0)
)