Feature Proposal: Variation on TRIM to remove all spaces
Motivation
TRIM reduces multiple spaces to one space. But there needs to be a variant that removes all spaces, e.g. to turn "Hello, world" into "HelloWorld".
I'm looking for the reverse of PROPERSPACE.
Description and Documentation
See
Tasks.Item9343
This works:
%CALC{$TRANSLATE($SUBSTITUTE($TRANSLATE(a string with comma, and spaces, $sp$comma, $CHAR(29)$CHAR(30)), $CHAR(29)), $CHAR(30), $comma)}%
astringwithcomma,andspaces
but oh my that's too complex!
Examples
Impact
Implementation
--
Contributors: VickiBrown - 11 Sep 2010
Discussion
What you want is a "make wiki word" function. Does it have to be in SSP? SSP syntax has horrible problems with commas in data. A general purpose macro e.g. %MAKEWIKIWORD{"arbitrary string"}% would be fairly trivial to write, and a lot more robust.
--
CrawfordCurrie - 13 Sep 2010
Some of this is already built in the link handling as [[Trim all Spaces]] ->
Trim All Spaces does convert this to a wikiword. So exposing that link rendering function could be an option. This would also be consistent with special character handling. and [[Trim & All Spaces]] ->
Trim & All Spaces, which generate valid wikiwords internally.
--
GeorgeClark - 14 Mar 2011
For what it's worth, we have
ParameterizedVariables now, so - although we do need this new macro, somewhere - you can get by using:
* Set TRIM = %CALC{$TRANSLATE($SUBSTITUTE($TRANSLATE(%DEFAULT%, $sp$comma, $CHAR(29)$CHAR(30)), $CHAR(29)), $CHAR(30), $comma)}%
Test:
astringwithcomma,andspaces
Edit: Ah, I realized you really want a macro to expose the yet-to-be-completed
AddFoswikiFuncWikifyWebTopicName functionality. Adding this proposal for a use-case of that.
--
PaulHarvey - 23 Feb 2012