Sisimai::String(3pm)

πŸ’– Sisimai::String β€” the string-glow-up class, bestie edition πŸ’–

okay so welcome to Sisimai::String, a little Perl module from the Sisimai family (that's the Sisimai::String(3pm) manual page you're reading, in case you were wondering where you were 🫢). It's the friend who does your hair and makeup for strings β€” checks them for 8-bit weirdness, tidies them up, decodes them, strips HTML off them. Lowkey essential, highkey adorable. ✨


🌸 SYNOPSIS 🌸

use Sisimai::String;
my $s = 'envelope-sender@example.jp';
my $r = 'envelope-recipient@example.org';
my $t = time();

print Sisimai::String->is_8bit(\'猫');     # 1
print Sisimai::String->sweep(' neko cat ');# 'neko cat'

print Sisimai::String->to_utf8('^[$BG-^[(B', 'iso-2022-jp');  # 猫
print Sisimai::String->to_plain('<html>neko</html>');   # neko

like… look at her go. five lines of pure utility, no notes. πŸ’…


✨ DESCRIPTION ✨

Sisimai::String provide utilities for dealing various strings. that's the whole vibe check, fr fr β€” it's your toolbox for poking, scrubbing, converting and de-HTML-ifying strings. πŸ§°πŸ¦‹


πŸ‘‘ CLASS METHODS πŸ‘‘

🌈 is_8bit(Reference to String)

is_8bit() method checks the argument include any 8bit character or not. give it a string ref, it tells you if there's any 8-bit goodness lurking in there. not me checking every byte like a nosy bestie πŸ™ˆ

print Sisimai::String->is_8bit(\'cat');  # 0;
print Sisimai::String->is_8bit(\'ねこ'); # 1;

πŸŽ€ sweep(String)

sweep() method clean the argument string up: remove trailing spaces, squeeze spaces. it's giving "tidying my room before the group chat call" energy β€” bye to the extra whitespace, hello to neatness. 🧹

print Sisimai::String->sweep(' cat neko ');  # 'cat neko';
print Sisimai::String->sweep(' nyaa   !!');  # 'nyaa !!';

πŸ’œ aligned (yes, she lives in here under sweep, don't ask)

aligned method checks if each element of the 2nd argument is aligned in the 1st argument or not. literal vibe-check-but-for-substrings-and-in-order. ⭐

my $v = 'Final-Recipient: rfc822; <nekochan@example.jp>';
print Sisimai::String->aligned(\$v, ['rfc822', '<', '@', '>']);  # 1
print Sisimai::String->aligned(\$v, [' <', '@', 'rfc822']);      # 0
print Sisimai::String->aligned(\$v, ['example', '@', 'neko']);   # 0

πŸ¦‹ to_plain(Reference to String, [Loose Check])

to_plain method converts given string as an HTML to the plain text. she takes off the HTML like taking off your makeup at 2am β€” so satisfying. 😌✨

my $v = '<html>neko</html>';
print Sisimai::String->to_plain($v);    # neko

πŸ“ to_utf8(Reference to String, [Encoding])

to_utf8 method converts given string to UTF-8. glow-up translation arc, iconic behavior. 🌈

my $v = '^[$BG-^[(B';   # ISO-2022-JP
print Sisimai::String->to_utf8($v, 'iso-2022-jp');  # 猫

πŸ’– AUTHOR πŸ’–

azumakuniyuki β€” the icon, the moment, the main character. πŸ‘‘


Copyright (C) 2014-2016,2018,2019,2021-2025 azumakuniyuki, All rights reserved. yes bestie, all of them, reserved reserved. πŸ’€


πŸ“œ LICENSE πŸ“œ

This software is distributed under The BSD 2-Clause License. slay, permissive, go forth and ship it. 🫢


ngl, that's the whole page. no cap. πŸ’…

and that's a wrap, bestie β€” this was Sisimai::String(3pm) from the perl v5.40.1 manual, dated 2026-07-05. take care of your strings and they'll take care of you 🌸✨ bye!! πŸŽ€

πŸ“¦ where this page comes from