How to manipulate the cases of letters in a string?

How to manipulate the cases of letters in a string?

am 05.10.2007 01:47:47 von xz

Say, change "i LOVE this Game" into "I LOVE THIS GAME" or "i love this
game"

?

Re: How to manipulate the cases of letters in a string?

am 05.10.2007 02:02:25 von Jim Gibson

In article <1191541667.632448.15320@g4g2000hsf.googlegroups.com>, xz
wrote:

> Say, change "i LOVE this Game" into "I LOVE THIS GAME" or "i love this
> game"

perldoc -f uc
perldoc -f lc

--
Jim Gibson

Posted Via Usenet.com Premium Usenet Newsgroup Services
----------------------------------------------------------
** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
----------------------------------------------------------
http://www.usenet.com

Re: How to manipulate the cases of letters in a string?

am 05.10.2007 02:17:24 von Paul Lalli

On Oct 4, 7:47 pm, xz wrote:
> Say, change "i LOVE this Game" into "I LOVE THIS GAME" or "i love this
> game"

Jim has already given you the answer, so just some extra
information... You may not be aware of this, but you can get a listing
of ALL Perl functions, ordered by category, by typing this at your
command prompt:

perldoc perlfunc

If you do that, you will see, for example:
Functions for SCALARs or strings
"chomp", "chop", "chr", "crypt", "hex", "index", "lc",
"lcfirst", "length", "oct", "ord", "pack", "q/STRING/",
"qq/STRING/", "reverse", "rindex", "sprintf", "substr",
"tr///", "uc", "ucfirst", "y///"

Perhaps not the most helpful in this case, as it may not be intuitive
that "lc" stands for "lowercase", but it's still good to know in
general.

Paul Lalli

Re: How to manipulate the cases of letters in a string?

am 05.10.2007 02:18:53 von gbacon

In article <1191541667.632448.15320@g4g2000hsf.googlegroups.com>,
xz wrote:

: Say, change "i LOVE this Game" into "I LOVE THIS GAME" or "i love this
: game"

$ cat try
#! /usr/bin/perl

$_ = "i LOVE this Game";

print "\U$_\n",
"\L$_\n";

$ ./try
I LOVE THIS GAME
i love this game

Hope this helps,
Greg
--
When asked by the king what he thought he was doing by infesting the sea, he
replied with noble insolence, "What do you think you are doing by infesting
the whole world? Because I do it with one puny boat, I am called a pirate;
because you do it with a great fleet, you are called an emperor." --Augustine

Re: How to manipulate the cases of letters in a string?

am 05.10.2007 06:29:56 von Petr Vileta

Jim Gibson wrote:
> In article <1191541667.632448.15320@g4g2000hsf.googlegroups.com>, xz
> wrote:
>
>> Say, change "i LOVE this Game" into "I LOVE THIS GAME" or "i love
>> this game"
>
> perldoc -f uc
> perldoc -f lc

Your answer is short and to the subject, but not all perl programmers use
Linux. I can mention only that some of us are using ActiveState Perl and we
have not any perldoc.exe on our Windows PCs :-)
Maybe will be better to write some "OS independent", e.g. "look at function
uc()".
I don't know what type of documentation is on Mac.
--

Petr Vileta, Czech republic
(My server rejects all messages from Yahoo and Hotmail. Send me your mail
from another non-spammer site please.)

Re: How to manipulate the cases of letters in a string?

am 05.10.2007 07:16:36 von Scott Bryce

Petr Vileta wrote:

> Your answer is short and to the subject, but not all perl programmers
> use Linux. I can mention only that some of us are using ActiveState Perl
> and we have not any perldoc.exe on our Windows PCs :-)


Yes, we do. I'm on Windows Vista, and it works for me. Even if it
didn't, so what? I can always go to perldoc.perl.org and do a search for
uc and lc.

The answer Jim Gibson gave is fine, even for those of us on Windows.

Re: How to manipulate the cases of letters in a string?

am 05.10.2007 10:15:58 von Reinhard Pagitsch

Petr Vileta wrote:
> Jim Gibson wrote:
>> In article <1191541667.632448.15320@g4g2000hsf.googlegroups.com>, xz
>> wrote:
>>
>>> Say, change "i LOVE this Game" into "I LOVE THIS GAME" or "i love
>>> this game"
>>
>> perldoc -f uc
>> perldoc -f lc
>
> Your answer is short and to the subject, but not all perl programmers
> use Linux. I can mention only that some of us are using ActiveState Perl
> and we have not any perldoc.exe on our Windows PCs :-)

We have perldoc.bat on our system in the \perl\bin directory.
And we have also the HTML documentation under \perl\html.
Simply open the index.html, in the left frame search for perlfunc, klick
it and search for upper.


> Maybe will be better to write some "OS independent", e.g. "look at
> function uc()".
> I don't know what type of documentation is on Mac.

I think the same as on Win. or Unix: perldoc and/or the HTML documentation.

regards,
Reinhard

--

Re: How to manipulate the cases of letters in a string?

am 05.10.2007 17:50:16 von xz

On Oct 5, 3:15 am, Reinhard Pagitsch wrote:
> Petr Vileta wrote:
> > Jim Gibson wrote:
> >> In article <1191541667.632448.15...@g4g2000hsf.googlegroups.com>, xz
> >> wrote:
>
> >>> Say, change "i LOVE this Game" into "I LOVE THIS GAME" or "i love
> >>> this game"
>
> >> perldoc -f uc
> >> perldoc -f lc
>
> > Your answer is short and to the subject, but not all perl programmers
> > use Linux. I can mention only that some of us are using ActiveState Perl
> > and we have not any perldoc.exe on our Windows PCs :-)
>

> We have perldoc.bat on our system in the \perl\bin directory.
> And we have also the HTML documentation under \perl\html.
Do you know where is this html documentation on linux?
Thanks!

> Simply open the index.html, in the left frame search for perlfunc, klick
> it and search for upper.
>
> > Maybe will be better to write some "OS independent", e.g. "look at
> > function uc()".
> > I don't know what type of documentation is on Mac.
>
> I think the same as on Win. or Unix: perldoc and/or the HTML documentation.
>
> regards,
> Reinhard
>
> --

Re: How to manipulate the cases of letters in a string?

am 05.10.2007 20:34:51 von Jim Gibson

In article , Petr Vileta
wrote:

> Jim Gibson wrote:
> > In article <1191541667.632448.15320@g4g2000hsf.googlegroups.com>, xz
> > wrote:
> >
> >> Say, change "i LOVE this Game" into "I LOVE THIS GAME" or "i love
> >> this game"
> >
> > perldoc -f uc
> > perldoc -f lc
>
> Your answer is short and to the subject, but not all perl programmers use
> Linux. I can mention only that some of us are using ActiveState Perl and we
> have not any perldoc.exe on our Windows PCs :-)
> Maybe will be better to write some "OS independent", e.g. "look at function
> uc()".

No time. :)

> I don't know what type of documentation is on Mac.

perldoc

--
Jim Gibson

Posted Via Usenet.com Premium Usenet Newsgroup Services
----------------------------------------------------------
** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
----------------------------------------------------------
http://www.usenet.com

Re: How to manipulate the cases of letters in a string?

am 05.10.2007 21:15:04 von xz

On Oct 5, 10:50 am, xz wrote:
> On Oct 5, 3:15 am, Reinhard Pagitsch wrote:
>
>
>
> > Petr Vileta wrote:
> > > Jim Gibson wrote:
> > >> In article <1191541667.632448.15...@g4g2000hsf.googlegroups.com>, xz
> > >> wrote:
>
> > >>> Say, change "i LOVE this Game" into "I LOVE THIS GAME" or "i love
> > >>> this game"
>
> > >> perldoc -f uc
> > >> perldoc -f lc
>
> > > Your answer is short and to the subject, but not all perl programmers
> > > use Linux. I can mention only that some of us are using ActiveState Perl
> > > and we have not any perldoc.exe on our Windows PCs :-)
>
> > We have perldoc.bat on our system in the \perl\bin directory.
> > And we have also the HTML documentation under \perl\html.
>



> Do you know where is this html documentation on linux?
> Thanks!
Just figured out this..... thank you guys.

>
> > Simply open the index.html, in the left frame search for perlfunc, klick
> > it and search for upper.
>
> > > Maybe will be better to write some "OS independent", e.g. "look at
> > > function uc()".
> > > I don't know what type of documentation is on Mac.
>
> > I think the same as on Win. or Unix: perldoc and/or the HTML documentation.
>
> > regards,
> > Reinhard
>
> > --

Re: How to manipulate the cases of letters in a string?

am 05.10.2007 23:33:46 von Sherm Pendley

Reinhard Pagitsch writes:

> Petr Vileta wrote:
>
>> Maybe will be better to write some "OS independent", e.g. "look at
>> function uc()".
>> I don't know what type of documentation is on Mac.
>
> I think the same as on Win. or Unix: perldoc and/or the HTML documentation.

Or ShuX. :-)

sherm--

--
Web Hosting by West Virginians, for West Virginians: http://wv-www.net
Cocoa programming in Perl: http://camelbones.sourceforge.net

Re: How to manipulate the cases of letters in a string?

am 06.10.2007 02:28:50 von Tad McClellan

xz wrote:
> On Oct 5, 3:15 am, Reinhard Pagitsch wrote:
>> Petr Vileta wrote:

>> And we have also the HTML documentation under \perl\html.

> Do you know where is this html documentation on linux?


perldoc pod2html


--
Tad McClellan
email: perl -le "print scalar reverse qq/moc.noitatibaher\100cmdat/"

Re: How to manipulate the cases of letters in a string?

am 18.10.2007 04:11:02 von 1usa

"Petr Vileta" wrote in
news:fe4fgi$1623$1@ns.felk.cvut.cz:

> Jim Gibson wrote:
>> In article <1191541667.632448.15320@g4g2000hsf.googlegroups.com>, xz
>> wrote:
>>
>>> Say, change "i LOVE this Game" into "I LOVE THIS GAME" or "i love
>>> this game"
>>
>> perldoc -f uc
>> perldoc -f lc
>
> Your answer is short and to the subject, but not all perl programmers
> use Linux. I can mention only that some of us are using ActiveState
> Perl and we have not any perldoc.exe on our Windows PCs :-)

C:\DOCUME~1\asu1\LOCALS~1\Temp> perldoc -f uc
uc EXPR
uc
Returns an uppercased version of EXPR. This is the internal
function implementing the "\U" escape in double-quoted strings.
Respects current LC_CTYPE locale if "use locale" in force. See
perllocale and perlunicode for more details about locale and
Unicode support. It does not attempt to do titlecase mapping on
initial letters. See "ucfirst" for that.

If EXPR is omitted, uses $_.

--
A. Sinan Unur <1usa@llenroc.ude.invalid>
(remove .invalid and reverse each component for email address)
clpmisc guidelines: