为什么我在cfoutput中调用函数时ColdFusion会添加空格?

为什么我在cfoutput中调用函数时ColdFusion会添加空格?,coldfusion,whitespace,Coldfusion,Whitespace,如果我在ColdFusion中这样做: <cfoutput>foo="#foo()#"</cfoutput> 但是,如果不是函数调用,则可以正常工作,即: <cfset fooOut=foo() /> <cfoutput>foo="#fooOut#"</cfoutput> 这个额外的空间是从哪里来的?我能做些什么吗 编辑为了澄清,空格不在myfoo函数返回的值中: <cffunction name="foo" access=

如果我在ColdFusion中这样做:

<cfoutput>foo="#foo()#"</cfoutput>
但是,如果不是函数调用,则可以正常工作,即:

<cfset fooOut=foo() />
<cfoutput>foo="#fooOut#"</cfoutput>
这个额外的空间是从哪里来的?我能做些什么吗


编辑为了澄清,空格不在my
foo
函数返回的值中:

<cffunction name="foo" access="public" returntype="string">
  <cfreturn "BAR" />
</cffunction>
但是,如果我将函数的输出传递给内置函数,就会发生这种情况(这部分对我来说毫无意义)。i、 e:


查看这是否有助于确保将输出属性定义为false

<cfcomponent output="false">

  <cffunction name="foo" access="public" returntype="string" output="false">
    <cfreturn "BAR">
  </cffunction>

</cfcomponent>

这绝对是一个黑客攻击,没有回答你的问题,但是你是否尝试过使用Trim()函数删除空白?@dbyrne:我尝试过,但是foo()返回的值没有空格,所以Trim什么都不做,然后Trim的结果会得到一个添加到其中的空格,就像foo()的结果一样有人知道为什么要添加空格字符吗?
<cffunction name="foo" access="public" returntype="string">
  <cfreturn "BAR" />
</cffunction>
<cfoutput>"#UCase("bar")#"</cfoutput>
"BAR"
<cfoutput>"#UCase(foo())#"</cfoutput>
" BAR"
<cfcomponent output="false">

  <cffunction name="foo" access="public" returntype="string" output="false">
    <cfreturn "BAR">
  </cffunction>

</cfcomponent>
function foo()
{
  return "BAR";
}