[英]Mysterious space at beginning when string returned from a function
為什么在函數返回的字符串的開頭有空格?
解決方案似乎很容易,但我無法找到原因。
碼
<cffunction name="getString" returntype="string">
<cfreturn "hello">
</cffunction>
<cfoutput>
[#getString()#] = getString()
</cfoutput>
產量
[ hello] = getString()
默認情況下,CFML函數將生成輸出,包括空格。 這可能會導致不必要的空白。 將output =“false”添加到您的函數中。
<cffunction name="encodeMyPath" returntype="string" output="false">
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.