Add some string functions
This commit is contained in:
parent
b0d9bf447e
commit
11ee4d006b
1 changed files with 8 additions and 0 deletions
|
@ -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;
|
||||||
|
|
Loading…
Reference in a new issue