Yup, looks like it gets stripped:
Code:
core2quad $ sh
$ ST="_ _" ; L=' ' ; ST="$ST$L" ; echo ${#ST}
4
$ ST="_ _" ; L=' ' ; ST="$(echo $ST$L)" ; echo ${#ST}
3
The same behavior will be seen where you try to return a string with a trailing IFS character at the end of the function, unless you escape the string.
Use the %q format to printf rather than echo to return a string that might have a trailing IFS character.