NAME

Devel::Ladybug::Str - Overloaded object class for strings

DESCRIPTION

Extends Devel::Ladybug::Scalar for string operations.

SYNOPSIS

use Devel::Ladybug::Str;

my $string = Devel::Ladybug::Str->new("Lorem Ipsum");

#
# Overloaded to work like a native string
#
print "$string\n";

if ( $string =~ /Ipsum/ ) {
  print "Word\n";
}

PUBLIC INSTANCE METHODS

  • $self->split($splitRegex)

    Object wrapper for Perl's built-in split() function. Functionally the same as split($splitStr, $self).

    Returns a new Devel::Ladybug::Array containing the split elements.

    my $scalar = Devel::Ladybug::Scalar->new("Foo, Bar, Rebar, D-bar");
    
    my $array  = $scalar->split(qr/, */);
    
    $array->each( sub {
      print "Have item: $_\n";
    } );
    
    # Have item: Foo
    # Have item: Bar
    # Have item: Rebar
    # Have item: D-bar
  • chomp, chop, chr, crypt, eval, index, lc, lcfirst, length, rindex, substr, uc, ucfirst

    These object methods are wrappers to built-in Perl functions. See perlfunc.

SEE ALSO

This file is part of Devel::Ladybug.