3
0
mirror of https://github.com/pragma-/pbot.git synced 2025-10-23 11:37:32 +02:00

Core/Utils: add isabbrev() subroutine

This commit is contained in:
Pragmatic Software 2025-10-22 19:42:51 -07:00
parent 71dab7278a
commit e2e153b50b
No known key found for this signature in database
GPG Key ID: CC916B6E3C84ECCE

View File

@ -0,0 +1,20 @@
# File: IsAbbrev.pm
#
# Purpose: Check is a string is an abbreviation of another string.
# SPDX-FileCopyrightText: 2017-2023 Pragmatic Software <pragma78@gmail.com>
# SPDX-License-Identifier: MIT
package PBot::Core::Utils::IsAbbrev;
use PBot::Imports;
require Exporter;
our @ISA = qw/Exporter/;
our @EXPORT = qw/isabbrev/;
sub isabbrev($str1, $str2) {
return (substr($str1, 0, length $str1) eq substr($str2, 0, length $str1));
}
1;