split string to chars
From: Frank de Bot (ppi_doesnt_like__at_spam_inhis_email_searchy.net)
Date: 03/29/04
- Next message: Gunnar Hjalmarsson: "Re: how to capture multiple lines?"
- Previous message: Richard Bell: "Re: LWP cookies"
- Next in thread: Gunnar Hjalmarsson: "Re: split string to chars"
- Reply: Gunnar Hjalmarsson: "Re: split string to chars"
- Reply: Anno Siegel: "Re: split string to chars"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Mon, 29 Mar 2004 16:51:03 +0200
Hi,
I got the following case
$string = "Test String";
@split = split(//,$string);
in each element of @split will be each character as string ( 'T\0' for
example)
But I want to have only the char in each element of the array, so this
could be done for example:
for ($i=0;$i<@split;$i++) {
printf "This char is: %c\n", $split[$i];
}
Is there any way to do this? I do know how to do this in C, but I've no
realy clue how to do this in perl.
thanks in advanced,
Frank de Bot
- Next message: Gunnar Hjalmarsson: "Re: how to capture multiple lines?"
- Previous message: Richard Bell: "Re: LWP cookies"
- Next in thread: Gunnar Hjalmarsson: "Re: split string to chars"
- Reply: Gunnar Hjalmarsson: "Re: split string to chars"
- Reply: Anno Siegel: "Re: split string to chars"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|