Split
.
Please, someone, give me a good reason why Split( str, "" )
returns str?! I want to be able to do something like:
my @chars = split(//, $str);
But noooooooooooooo.....
You might want to do this by hand... using a foreach loop and Left or something abominable to get each character of the string.
VBs code for split uses InStr and InStrRev (sp?) searching for the pattern and Mid to cut out the string.
I once parsed HTML brackets (a long time ago) for equality of said bracket numbers... yet I wrote my own split which was much faster.
Sorry to hear about your pain.
Re:string splitting...
pjm on 2003-08-27T03:57:06
Am I missing something here?
~ % perl -e 'print join("*",split "","something here"),"\n"'
s*o*m*e*t*h*i*n*g* *h*e*r*e
Or if you prefer...
~ % perl -e 'print join("*",split//,"something here"),"\n"'
s*o*m*e*t*h*i*n*g* *h*e*r*eRe:string splitting...
LTjake on 2003-08-27T11:13:14
To make an array of chars i did this:
Dim arrInput
ReDim arrInput( Len( strInput ) - 1 )
For intTemp = 1 To Len( strInput )
arrInput( intTemp - 1 ) = Mid( strInput, intTemp, 1 )
NextSucky, i know, but atleast doing:
strInput = Join( arrInput, "" )
works to get the string back!
:)