Search

How would I go about extending the charactercount with spaces for any giving word?

aword
anotherword
yetanotherword

should become

aword+++++++++++
anotherword+++++
yetanotherword++

The EXSLT padding() function should be useful here. Passing it the number of characters and a character and it returns a string of that length. So you’d first need to check your string length (string-length('aword')) and subtract this from the number of characters you want to end with, passing this difference to the str:padding() function.

Create an account or sign in to comment.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details