Why is there a space at the beginning of the string returned from a function?
The solutions seems easy but I am unable to find the reason.
Code
<cffunction name="getString" returntype="string">
<cfreturn "hello">
</cffunction>
<cfoutput>
[#getString()#] = getString()
</cfoutput>
Output
[ hello] = getString()
By default CFML functions will produce output, including whitespace. This can cause unwanted white space. Add output="false" to your function.
<cffunction name="encodeMyPath" returntype="string" output="false">
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With