Perl乱弹

# join, split, map 
sub normalise_name{
    join(" ", map {ucfirst lc $_} split(/\s+/, shift));   
}
print normalise_name("albert lee");

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

只是很正常的perl代码

只是很正常的perl代码。咋了

初学,大惊小怪而已

初学,大惊小怪而已。