2010/12/14 Federico Leva (Nemo)
<nemowiki@gmail.com>
Alex Brollo, 14/12/2010 09:10:
> 1. I'd like to have a {{nbsp:string}} function, to replace all spaces
> with html entities into string. It would very useful to format
> table cell content where spaces must be avoided, while saving the
> original string.
There's a class for this: http://en.wikipedia.org/wiki/Template:Nowrap
>
> 2. I'd like to generalize {{#titleparts:string}} transforming it into a
> general str.split() function something like {{split:string|char}} where
> string is the string to split, and char is the splitting character). I
> use a lot #titleparts as a "string-splitter", and I can manage difficult
> issues with ease (i.e.: how to pass multiple values into a single
> parameter of a template) but sometimes I'd like to use a character
> different from / (i.e. splitting a list of page/subpage names).
This should be http://www.mediawiki.org/wiki/Extension:StringFunctions ,
which will never be implemented in Wikimedia projects.
1. Thank you Nemo!! Problem solved.
2. There are lots of string functions already implemented - lc, uc, lcfirs, ucfirst, #titleparts... PAGENAME, FULLPAGENAME, BASEPAGENAME... - today. IMHO a generalized split function would be great to extend just a little bit the field of #titleparts to implement an efficient, simple way to manage simple arrays. StringFunctions could fire fantasy - split function would only increase efficiency to solve common issues.
Alex