Skip to main content

I am new to IFS… I can not get vldtstr:strReplaceAll('*12345*', '*', '') to produce ‘12345’    what am I doing wrong here.  Do I need an escape key for the ‘*’?   vldtstr:strReplaceAll('*12345*', '3', '') produces ‘*1245*’ as expected.   I am trying to strip off the ‘*’ for barcoding purposes in the report designer.

Hi Steve

Do try other options, considering StrReplaceAll() is not working for ‘*’.  ( not sure why though , the function is defined well )

Trim is one such option. The solution is copied from Functions (ifs.com) 

StrTrim(string,char)

Returns string with all specified characters (both trailing and leading)
removed from the string.

string : A string value you specify. This function removes

the character specified by char from this string.
char : The character to be removed from the string

StrTrim('####short addresses####','#')
In this example, the StrTrim function would return the string
'short addresses'. All leading and trailing '#' characters are trimmed.


I gave up on the StrReplaceAll() function,  it just doesn’t work with the ‘*’.  I was able to use the StrLTrim and StrRTrim() functions to work around it though.   These functions do recognize the ‘*’.

vldtstr:strRTrim(vldtstr:strRTrim(vldtstr:strLTrim(concat(tns:SHOP_ORDER_REP/tns:ORDER_NO,'-',tns:SHOP_ORDER_REP/tns:RELEASE_NO), '*'),'*'),'-')   *12345-* = 12345

 

Thank you for the reply

 


Reply