title: Substring,string-length function in xslt
body: <p>Basically I have a string created from a loop separated by commas eg. A,B,C,
  I want to get rid of the last comma.</p>
  
  <pre><code>&lt;xsl:variable name="myConcatString"&gt;
     &lt;xsl:for-each select="valueinElement"&gt;
          &lt;xsl:value-of select="@attributeValue"/&gt;,
     &lt;/xsl:for-each&gt;
  &lt;/xsl:variable&gt;
  
  
  &lt;xsl:variable name="valueLength" select="string-length($myConcatString)-1"/&gt;
  &lt;xsl:value-of select="substring($myConcatString,1,$valueLength)"/&gt;
  </code></pre>
  
  <p>Now the last line should give me A,B,C without the "," in the last. Can someone tell me what is going wrong?</p>