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 π
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
- ubuntu stonking: libsisimai-perl 5.7.0-1 Β· BSD-2-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms