1 Reply Latest reply on Apr 30, 2010 8:34 AM by ilssac

    cffunction returns space

    chandra12345 Level 1

      Hi,

       

      I am using coldfusionmx6 and created function.while it calling in xml it giving space.How to delete space?

       

      <cffunction name="datereplaceformat" returntype="string">
        <cfargument default="" name="datechange" required="No">
         <cfargument default="" name="formatchange" required="No">
      <CFSET var SDATE=reREPLACE(datechange,"#formatchange#"," ","all")>
      <CFSET var rspace=reREPLACE(SDATE," ","","all")>
      <cfreturn rspace>
      </cffunction>

       

      sample xml:

       

      <cfoutput>

      <va4>

       

      <datepost>#trim(datereplaceformat(variables.NotPostedTransDate,"/"))#</datepost>

       

      </va4>

      </cfoutput>

       

      In posting page it showing as

       

      <va4>

       

      <datepost>

       

       

       

       

      10302010

      </datepost>

       

      </va4>

       

       

      Advance Thanks

        • 1. Re: cffunction returns space
          ilssac Level 5

          Adding the output="no" property to the the <cffunction...> tag so that ColdFusion does not include any whitespace from the function may help.

           

          You may also want to consider some of ColdFusion's other whitespace management features.  <cfsilent>...</cfsilent>  <cfsetting enableCFoutputOnly="Yes"> being a couple of the most utilized.

          1 person found this helpful