The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Hydrogen::Topic::String - functions from Hydrogen::String applied to $_

VERSION

This documentation is for Hydrogen::Topic::String 0.016, which is based on Sub::HandlesVia::HandlerLibrary::String 0.037.

FUNCTIONS

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()

Operates on $_, which must be a string scalar.

Like chomp from perlfunc.

chop()

Operates on $_, which must be a string scalar.

Like chop from perlfunc.

clear()

Operates on $_, which must be a string scalar.

Sets the string to the empty string.

cmp( $str )

Operates on $_, which must be a string scalar.

Arguments: Str.

Returns $_ cmp $str.

cmpi( $str )

Operates on $_, which must be a string scalar.

Arguments: Str.

Returns fc($_) cmp fc($str). Uses lc instead of fc in versions of Perl older than 5.16.

contains( $str )

Operates on $_, which must be a string scalar.

Arguments: Str.

Returns true iff the string contains $str.

contains_i( $str )

Operates on $_, which must be a string scalar.

Arguments: Str.

Returns true iff the string contains $str case-insensitvely.

ends_with( $tail )

Operates on $_, which must be a string scalar.

Arguments: Str.

Returns true iff the string ends with $tail.

ends_with_i( $tail )

Operates on $_, which must be a string scalar.

Arguments: Str.

Returns true iff the string ends with $tail case-insensitvely.

eq( $str )

Operates on $_, which must be a string scalar.

Arguments: Str.

Returns $_ eq $str.

eqi( $str )

Operates on $_, which must be a string scalar.

Arguments: Str.

Returns fc($_) eq fc($str). Uses lc instead of fc in versions of Perl older than 5.16.

fc()

Operates on $_, which must be a string scalar.

Returns fc($_).

ge( $str )

Operates on $_, which must be a string scalar.

Arguments: Str.

Returns $_ ge $str.

gei( $str )

Operates on $_, which must be a string scalar.

Arguments: Str.

Returns fc($_) ge fc($str). Uses lc instead of fc in versions of Perl older than 5.16.

get()

Operates on $_, which must be a string scalar.

Gets the current value of the string.

gt( $str )

Operates on $_, which must be a string scalar.

Arguments: Str.

Returns $_ gt $str.

gti( $str )

Operates on $_, which must be a string scalar.

Arguments: Str.

Returns fc($_) gt fc($str). Uses lc instead of fc in versions of Perl older than 5.16.

inc()

Operates on $_, which must be a string scalar.

Performs ++ on the string.

lc()

Operates on $_, which must be a string scalar.

Returns lc($_).

le( $str )

Operates on $_, which must be a string scalar.

Arguments: Str.

Returns $_ le $str.

lei( $str )

Operates on $_, which must be a string scalar.

Arguments: Str.

Returns fc($_) le fc($str). Uses lc instead of fc in versions of Perl older than 5.16.

length()

Operates on $_, which must be a string scalar.

Like length from perlfunc.

lt( $str )

Operates on $_, which must be a string scalar.

Arguments: Str.

Returns $_ lt $str.

lti( $str )

Operates on $_, which must be a string scalar.

Arguments: Str.

Returns fc($_) lt fc($str). Uses lc instead of fc in versions of Perl older than 5.16.

match( $regexp )

Operates on $_, which must be a string scalar.

Arguments: Str|RegexpRef.

Returns true iff the string matches the regexp.

match_i( $regexp )

Operates on $_, which must be a string scalar.

Arguments: Str|RegexpRef.

Returns true iff the string matches the regexp case-insensitively.

ne( $str )

Operates on $_, which must be a string scalar.

Arguments: Str.

Returns $_ ne $str.

nei( $str )

Operates on $_, which must be a string scalar.

Arguments: Str.

Returns fc($_) ne fc($str). Uses lc instead of fc in versions of Perl older than 5.16.

prepend( $head )

Operates on $_, which must be a string scalar.

Arguments: Str.

Prepends another string to the start of the current string and updates the original value.

replace( $regexp, $replacement )

Operates on $_, which must be a string scalar.

Arguments: Str|RegexpRef, Str|CodeRef.

Replaces the first regexp match within the string with the replacement string.

replace_globally( $regexp, $replacement )

Operates on $_, which must be a string scalar.

Arguments: Str|RegexpRef, Str|CodeRef.

Replaces the all regexp matches within the string with the replacement string.

reset()

Operates on $_, which must be a string scalar.

Resets the original value to its default value, or an empty string if it has no default.

set( $value )

Operates on $_, which must be a string scalar.

Arguments: Str.

Sets the string to a new value.

starts_with( $head )

Operates on $_, which must be a string scalar.

Arguments: Str.

Returns true iff the string starts with $head.

starts_with_i( $head )

Operates on $_, which must be a string scalar.

Arguments: Str.

Returns true iff the string starts with $head case-insensitvely.

substr( $start, $length?, $replacement? )

Operates on $_, which must be a string scalar.

Arguments: Int, Optional[Int], Optional[Str].

Like substr from perlfunc, but is not an lvalue.

uc()

Operates on $_, which must be a string scalar.

Returns uc($_).

EXPORT

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.

BUGS

Please report any bugs to http://github.com/tobyink/p5-hydrogen/issues.

SEE ALSO

Hydrogen, Hydrogen::String, Hydrogen::Curry::String, Sub::HandlesVia::HandlerLibrary::String.

AUTHOR

Toby Inkster <tobyink@cpan.org>.

COPYRIGHT AND LICENCE

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.

DISCLAIMER OF WARRANTIES

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.