split string to chars

From: Frank de Bot (ppi_doesnt_like__at_spam_inhis_email_searchy.net)
Date: 03/29/04


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



Relevant Pages

  • Re: split string to chars
    ... > Frank de Bot wrote: ... >> But I want to have only the char in each element of the array, ... > perldoc -f map ...
    (comp.lang.perl.misc)
  • Re: split string to chars
    ... Frank de Bot wrote: ... > But I want to have only the char in each element of the array, ... perldoc -f map ...
    (comp.lang.perl.misc)
  • Re: Pointer
    ... require in input a pointer char: ... unsafe public static extern int OpenFile; ... What is it pointing to exactly, is it pointing to a "Unicode character" array or is it pointing to a "Single byte character" array or is it pointing to something else? ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Problem with va_ macros and arrays of arrays
    ... > the arrays passed to a ... > specific char, somewhat similar to what the standard function ... that with an array of struct, or possibly a pointer to a dynamic array ... > As I'm still a beginner in C without a copy of the standard I ...
    (comp.lang.c)
  • Re: Pointer
    ... require in input a pointer char: ... unsafe public static extern int OpenFile; ... What is it pointing to exactly, is it pointing to a "Unicode character" array or is it ...
    (microsoft.public.dotnet.languages.csharp)