(Newbie responding)
I think:

$part2 = substr($part1, 0, 4);

That's string, position from which to start, length

The parentheses aren't technically necessary; I just like them...
-J


                                                                                       
                             
                    Greg.Froese@Fe                                                     
                             
                    derated.CA            To:     [EMAIL PROTECTED]                   
                             
                                          cc:                                          
                             
                    09/25/01 10:32        Subject:     parsing strings                 
                             
                    AM                                                                 
                             
                                                                                       
                             
                                                                                       
                             




Hi,

I've been programming for a number of years, but I'm VERY new to Perl, and
it looks like a lot of fun.  However, I'm very much in the learning stage,
so please be patient, I'm still learning all the keywords etc...

I'm curious how I can parse part of one variable into another

ex:
$part1 = "this is a great day"
# I want $part2 = the first four letters of $part1 (this)

how would I do this?




-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to