title: How to truncate a string in groovy?
body: <p>How to truncate string in groovy?</p>
  
  <p>I used:</p>
  
  <pre><code>def c = truncate("abscd adfa dasfds ghisgirs fsdfgf", 10)
  </code></pre>
  
  <p>but getting error.</p>