Ordinary macros can't remove whitespace — only add.

With my formulas plugin <http://evanbalster.com/tiddlywiki/formulas.html> 
installed, 
you could remove the spaces from {{!!webid}} using this macro-call:

<<formula "regexreplace({{!!webid}}, ' ', '')">>

(This would replace {{!!webid}} in your example.)


If you need to replace other kinds of whitespace like tabs, newlines, etc, 
you can use a slightly more general regex:

<<formula "regexreplace({{!!webid}}, '\\s+', '')">>


On Monday, 8 January 2018 17:16:26 UTC-6, tobaisch wrote:
>
> Hello,
> Mark and Eric here from the forum helped me with a macro which adds the 
> content of a field with id numbers to a ext. website link.
> Sometimes the field content also has empty space between the numbers. for 
> example. "22 33 44"
> How can you complete the macro that removes this spaces?
> Here is the macro:
>
> \define mymacro2(web id) [ext[Linktext|$web$$id$]]
> \define mymacro() <$macrocall $name="mymacro2" web="
> https://mydomain.com/files/"; id={{!!webid}}/>
>
> the webid is the field with the numbers
> Thanks
> Regards
> Tob
>

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/12b5d522-fec8-4ce0-9a77-70e90d985c55%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to