Add some string functions

This commit is contained in:
madmaurice 2021-04-03 18:47:45 +02:00
parent b0d9bf447e
commit 11ee4d006b

View file

@ -227,6 +227,14 @@ my %stdctx = (
'string-not-greaterp' => sub { my ($a, $b) = @_; return !(lc($a) gt lc($b)); }, 'string-not-greaterp' => sub { my ($a, $b) = @_; return !(lc($a) gt lc($b)); },
'string-not-lessp' => sub { my ($a, $b) = @_; return !(lc($a) lt lc($b)); }, 'string-not-lessp' => sub { my ($a, $b) = @_; return !(lc($a) lt lc($b)); },
# string operations
'string-upcase' => sub { return uc(shift); },
'string-downcase' => sub { return lc(shift); },
'string-capitalize' => sub {
my $str = shift;
return $str =~ s/(\S+)/ucfirst($1)/erg;
},
# Bitwise operations # Bitwise operations
'logand' => sub { 'logand' => sub {
my $v = -1; my $v = -1;