rah_trim

Published under current TXP projects

Container tag for Textpattern CMS that allows you to strip appending and prepending whitespace from a string. Works just like when PHP’s ltrim(), rtrim() and trim() joined forces.

Download rah_trim v0.1

Image: rah_trim

Image: rah_trim

Requirements

Installation and usage

The general behavior stands: paste plugin code to the plugin installer textarea and run the automatic setup. Then just activate the plugin and you are ready to use new tags that plugin includes like others.

Attributes

The tag, <txp:rah_trim>, is a container tag and attributes for it follow.

direction
Which end of a string to strip. Available values left, right and both.
Example: direction="left" Default: "both"

charlist
Custom characters to be stripped. If left to unset, the tag will strip " ", \t, \n, \r, \0 and \x0b. Default is unset.
Example: charlist="\t,a,b,c" Default: "" (unset)

Example

<txp:rah_trim direction="left">
	Our site's name:
	<txp:site_name />
</txp:rah_trim>

Changelog

Version 0.1