oneline
Discard all but the first line of the body text.
The first line ends with any one of the following:
- Carriage return ("\r").
- Line feed ("\n").
- ASCII NUL ("\0").
See also:
- The line filter, which also discards all but the first line of the body text, but has a different rule as to what is classed at the end of a line.
- The nullselect filter, which discards everything after the first ASCII NUL ("\0") character.
|
Availability
This filter was introduced in version 5.4.0,
and is therefore not available for use with any earlier Interchange version.
|
Example
[filter oneline]Line 1
Line 2
Line 3
[/filter]
|
Results in:
Source code
sub {
my $val = shift;
$val =~ s/[\r\n\0].*//s;
return $val;
}
|
If you would like to become an interchange.RTFM.info sponsor,
and get your logo into our list,
then please contact us.
The sponsorship logo list is also displayed on our home page.