For Programmers: Free Programming Magazines  


Home > Archive > PERL Programming > May 2005 > EZ answer I'm sure.









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author EZ answer I'm sure.
AHutchins

2005-05-26, 5:17 pm

Is there a function in perl such as toLowerCase() in Java? Or anything that will change all the characters from one case to the other?
displeaser

2005-05-27, 4:55 am

Hi,

I think you mean the lc function, example follows.

use warnings;
use strict;

my $string = "HELLO WORLD";

print lc($string),"\n";



Displeaser
displeaser

2005-05-27, 5:09 am

Oops,

forgot you can do this too

use warnings;
use strict;

my $string = "HELLO WORLD";

print"\L$string\n"; #prints hello world
print"\l$string\n"; #prints hELLO WORLD

# \L will convert to lowercase until a \E is found
# \l will convert the next character to lower case

print"\l$string\n";



Displeaser
AHutchins

2005-05-27, 11:27 am

Awesome! Thanks for the help.
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com