To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.off-topic.geekOpen lugnet.off-topic.geek in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Off-Topic / Geek / 572
571  |  573
Subject: 
Perl question
Newsgroups: 
lugnet.off-topic.geek
Date: 
Mon, 4 Oct 1999 22:16:28 GMT
Viewed: 
90 times
  
Any nice easy way to make a string all lower case? ("nice easy way" being
defined as being less than 5 lines...)I seem to remember being able to use
'pack' to do that in some fashion or another... and of course I foolishly
tried: "$string =~ s/[A-Z]/[a-z]/g;" but of course that was just a desperate
hope that it might be easy... any suggestions?

DaveE



Message has 1 Reply:
  Re: Perl question
 
(...) Try this: $string = lc $string; Alternatively, I think this will work also: $string =~ tr/[A-Z]/[a-z]/; But if you *REALLY* want to make it look impressive (to a 1st-year programmer anyway :-), you could do: @upchars = qw( A B C D E F G H I J (...) (25 years ago, 4-Oct-99, to lugnet.off-topic.geek)

3 Messages in This Thread:

Entire Thread on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

Custom Search

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR