1 package Moose::Autobox::String;
6 with 'Moose::Autobox::Value';
10 sub lc { CORE::lc $_[0] }
11 sub lcfirst { CORE::lcfirst $_[0] }
12 sub uc { CORE::uc $_[0] }
13 sub ucfirst { CORE::ucfirst $_[0] }
14 sub chomp { CORE::chomp $_[0] }
15 sub chop { CORE::chop $_[0] }
16 sub reverse { CORE::reverse $_[0] }
17 sub length { CORE::length $_[0] }
18 sub sprintf { CORE::sprintf $_[0], @_[1..$#_] }
19 sub lines { [ CORE::split '\n', $_[0] ] }
20 sub words { [ CORE::split ' ', $_[0] ] }
22 return CORE::index($_[0], $_[1]) if scalar @_ == 2;
23 return CORE::index($_[0], $_[1], $_[2]);
26 return CORE::rindex($_[0], $_[1]) if scalar @_ == 2;
27 return CORE::rindex($_[0], $_[1], $_[2]);
30 return [ CORE::split($_[1], $_[0]) ] if scalar @_ == 2;
31 return [ CORE::split($_[1], $_[0], $_[2]) ];
42 Moose::Autobox::String - the String role
48 "Hello World"->uc; # HELLO WORLD
52 This is a role to describes a String value.
80 $string->split($pattern);
84 This is equivalent to splitting on space.
88 This is equivalent to splitting on linelines.
100 All complex software has bugs lurking in it, and this module is no
101 exception. If you find a bug please either email me, or add the bug
106 Stevan Little E<lt>stevan@iinteractive.comE<gt>
108 =head1 COPYRIGHT AND LICENSE
110 Copyright 2006-2008 by Infinity Interactive, Inc.
112 L<http://www.iinteractive.com>
114 This library is free software; you can redistribute it and/or modify
115 it under the same terms as Perl itself.