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 new HTML::Microformats::Datatype::String object. 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 new HTML::Microformats::Datatype::String object out of a scalar, plus an XML::LibXML::Element. BUT β€” if $element is undef, 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 $str is blessed as a HTML::Microformats::Datatype::String object. 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::Microformats
  • HTML::Microformats::Datatype

go read those too, they're the extended universe. iykyk. 🧚


πŸ‘‘ AUTHOR πŸ‘‘

Toby Inkster <tobyink@cpan.org>. legend behaviour, fr fr. πŸ“


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