I cannot get the Substitute function to work correctly when using tokens for parameters. When I pass hard coded parameters, it does work correctly.
When using hard coded (input, old, and new) parameters of "Input_Test_Input", "Test", "Substitute", the substitute formula properly returns "Input_Substitute_Input". But, when I pass each of these parameters as token values, the input parameter is found, but the old and new parameters are not found, leaving the input value "Input_Test_Input". If I hard code the input and old parameters, and only pass the new parameter as a token, the result is "Input_ Substitute_Input". There is an extra space inserted before the new parameter. Going back, if I pass all three values as tokens, but include the extra space in the original string as "Input_ Test_Input", then the function works, although the result is of course "Input_ Substitute_Input".
Why do the old and new parameters, when passed from tokens, include a space at the beginning? Is there any way to prevent this from happening?