Hydrogen::Topic::String - functions from Hydrogen::String applied to $_
$_
This documentation is for Hydrogen::Topic::String 0.016, which is based on Sub::HandlesVia::HandlerLibrary::String 0.037.
Each function implicitly operates on $_, expecting it to be a string scalar.
append( $tail )
Operates on $_, which must be a string scalar.
Arguments: Str.
Appends another string to the end of the current string and updates the original value.
chomp()
Like chomp from perlfunc.
chomp
chop()
Like chop from perlfunc.
chop
clear()
Sets the string to the empty string.
cmp( $str )
Returns $_ cmp $str.
$_ cmp $str
cmpi( $str )
Returns fc($_) cmp fc($str). Uses lc instead of fc in versions of Perl older than 5.16.
fc($_) cmp fc($str)
lc
fc
contains( $str )
Returns true iff the string contains $str.
$str
contains_i( $str )
Returns true iff the string contains $str case-insensitvely.
ends_with( $tail )
Returns true iff the string ends with $tail.
$tail
ends_with_i( $tail )
Returns true iff the string ends with $tail case-insensitvely.
eq( $str )
Returns $_ eq $str.
$_ eq $str
eqi( $str )
Returns fc($_) eq fc($str). Uses lc instead of fc in versions of Perl older than 5.16.
fc($_) eq fc($str)
fc()
Returns fc($_).
fc($_)
ge( $str )
Returns $_ ge $str.
$_ ge $str
gei( $str )
Returns fc($_) ge fc($str). Uses lc instead of fc in versions of Perl older than 5.16.
fc($_) ge fc($str)
get()
Gets the current value of the string.
gt( $str )
Returns $_ gt $str.
$_ gt $str
gti( $str )
Returns fc($_) gt fc($str). Uses lc instead of fc in versions of Perl older than 5.16.
fc($_) gt fc($str)
inc()
Performs ++ on the string.
++
lc()
Returns lc($_).
lc($_)
le( $str )
Returns $_ le $str.
$_ le $str
lei( $str )
Returns fc($_) le fc($str). Uses lc instead of fc in versions of Perl older than 5.16.
fc($_) le fc($str)
length()
Like length from perlfunc.
length
lt( $str )
Returns $_ lt $str.
$_ lt $str
lti( $str )
Returns fc($_) lt fc($str). Uses lc instead of fc in versions of Perl older than 5.16.
fc($_) lt fc($str)
match( $regexp )
Arguments: Str|RegexpRef.
Returns true iff the string matches the regexp.
match_i( $regexp )
Returns true iff the string matches the regexp case-insensitively.
ne( $str )
Returns $_ ne $str.
$_ ne $str
nei( $str )
Returns fc($_) ne fc($str). Uses lc instead of fc in versions of Perl older than 5.16.
fc($_) ne fc($str)
prepend( $head )
Prepends another string to the start of the current string and updates the original value.
replace( $regexp, $replacement )
Arguments: Str|RegexpRef, Str|CodeRef.
Replaces the first regexp match within the string with the replacement string.
replace_globally( $regexp, $replacement )
Replaces the all regexp matches within the string with the replacement string.
reset()
Resets the original value to its default value, or an empty string if it has no default.
set( $value )
Sets the string to a new value.
starts_with( $head )
Returns true iff the string starts with $head.
$head
starts_with_i( $head )
Returns true iff the string starts with $head case-insensitvely.
substr( $start, $length?, $replacement? )
Arguments: Int, Optional[Int], Optional[Str].
Like substr from perlfunc, but is not an lvalue.
substr
uc()
Returns uc($_).
uc($_)
No functions are exported by this module by default. To import them all (this is usually a bad idea), use:
use Hydrogen::Topic::String -all;
To import a particular function, use:
use Hydrogen::Topic::String 'chop';
To rename functions:
use Hydrogen::Topic::String 'chop' => { -as => 'myfunc' };
On Perl 5.37.2+, you can import lexically:
use Hydrogen::Topic::String -lexical, 'chop';
See Exporter::Tiny::Manual::Importing for more hints on importing.
Please report any bugs to http://github.com/tobyink/p5-hydrogen/issues.
Hydrogen, Hydrogen::String, Hydrogen::Curry::String, Sub::HandlesVia::HandlerLibrary::String.
Toby Inkster <tobyink@cpan.org>.
This software is copyright (c) 2022 by Toby Inkster.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
To install Hydrogen, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Hydrogen
CPAN shell
perl -MCPAN -e shell install Hydrogen
For more information on module installation, please visit the detailed CPAN module installation guide.