HTML::...String(3pm)
π HTML::Microformats::Datatype::String β text in a particular language π
okay bestie, so this is a User Contributed Perl Documentation page for HTML::Microformats::Datatype::String β a whole module whose entire personality is "a bit of text, but make it multilingual". it's giving i know what language i'm in and i'm not sorry. π¦
β¨ SYNOPSIS β¨
my $string = HTML::Microformats::Datatype::String
->new('Bonjour', 'fr');
print "$string\n";
look at her. Bonjour, fr, printed. iconic. no notes. π
πΈ DESCRIPTION πΈ
π Constructor π
$str = HTML::Microformats::Datatype::String->new($text, [$lang])β makes you a shiny newHTML::Microformats::Datatype::Stringobject. yes the second arg is optional, she's flexible like that.
π Public Methods π
$str->langβ hands you back the language code. that's it. that's the whole method. queen of doing one thing well. π$str->to_stringβ returns a plain (scalar) string, so you can stop being fancy and just have the text.
β Functions β
$str = ms($text, [$element])β builds a brand newHTML::Microformats::Datatype::Stringobject out of a scalar, plus anXML::LibXML::Element. BUT β if$elementisundef, then it just returns the plain (scalar) string itself. no object, no ceremony, just vibes.
This function is exported by default.
(Note: the name 'ms' originally stood for 'Magic String'. β¨ yes really.)
isms($str)β returns true iff$stris blessed as aHTML::Microformats::Datatype::Stringobject. a little vibe check for your data type. π«Ά
This function is exported by default.
$c = concat($a, $b, [$reverse])β glues two strings together, bestie style.
If the language of string $b is null or the same as $a, then the resultant string has the same language as $a. Otherwise the result has no language. that's the rule, we don't make the rules.
If $reverse is true, then the strings are concatenated with $b preceding $a. order swap unlocked. π
This function is not exported by default.
Can also be used as a method:
$c = $a->concat($b);
compare($a, $b)β compares two strings alphabetically. Language is ignored. she doesn't care where you're from, only how you spell. π
Return values are as per 'cmp' (see perlfunc).
This function is not exported by default.
Can also be used as a method:
$a->compare($b);
π BUGS π
Please report any bugs to <http://rt.cpan.org/>. we listen, we promise. π
π SEE ALSO π
HTML::MicroformatsHTML::Microformats::Datatype
go read those too, they're the extended universe. iykyk. π§
π AUTHOR π
Toby Inkster <tobyink@cpan.org>. legend behaviour, fr fr. π
π COPYRIGHT AND LICENCE π
Copyright 2008-2012 Toby Inkster
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
π₯ DISCLAIMER OF WARRANTIES π₯
THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
so like. no promises. she said what she said. π
and that's the whole page bestie β¨ this one was generated as part of perl v5.32.1, dated 2021-09-12, under the HTML::...String(3pm) manual. go forth and be multilingual, you ate. π
π¦
π¦ where this page comes from
- debian bookworm: libhtml-microformats-perl 0.105-6 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libhtml-microformats-perl 0.105-6 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu jammy: libhtml-microformats-perl 0.105-6 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libhtml-microformats-perl 0.105-6 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libhtml-microformats-perl 0.105-6 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libhtml-microformats-perl 0.105-6 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms