Quiq::Concat - Konkateniere Zeichenketten
Quiq::Object
$str = $class->catIf($bool,sub {$expr,...});
Bedingung
Ausdrücke, deren Resultat konkateniert wird.
String
Ist Bedingung $bool falsch, liefere einen Leerstring. Andernfalls konkateniere die Werte der Ausdrücke $expr, ... und liefere das Resultat zurück. Evaluiert ein Ausdruck $expr zu undef, wird der Wert durch einen Leerstring ersetzt.
undef
Die Methode ist logisch äquivalent zu
$str = !$bool? '': join '',$expr // '', ...;
Konkatenation bei zutreffender Bedingung
Quiq::Concat->catIf(1,sub { 'Dies', 'ist', 'ein', undef, 'Test', }); # 'DiesisteinTest'
1.129
Frank Seitz, http://fseitz.de/
Copyright (C) 2019 Frank Seitz
This code is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install Quiq, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Quiq
CPAN shell
perl -MCPAN -e shell install Quiq
For more information on module installation, please visit the detailed CPAN module installation guide.