... with an empty expression string (would produce an array of all characters in the string in perl) will NOT produce an array but return the string as if cut with space as the expression.
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...
How about alternation? (Score:2)
Casey West
string splitting... (Score:1)
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...
Re:string splitting... (Score:1)
~ % 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
s*o*m*e*t*h*i*n*g* *h*e*r*e
Re:string splitting... (Score:1)
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 )
Next
Sucky, i know, but atleast doing:
strInput = Join( arrInput, "" )works to get the string back! :)