Originally Posted By: jmuirh
... I wasn't aware that the split command can use/discard multiple spaces when specified as a delimiter


It can't.

However, you can use the Join(Split()) replace trick to reduce multiple spaces to single characters before you parse the line.

There are some "squeeze()" or "compress()" UDFs knocking around, but it is easier to knock something up than search for it:


$sString=" A string with many spaces in it "
"Original string: '"+$sString+"'"+@CRLF
"Squeezed string: '"+udfSqueeze($sString)+"'"+@CRLF


Function udfSqueeze($s)
While InStr($s," ") $s=Join(Split($s," ")) Loop
$udfSqueeze=Trim($s)
Exit 0
EndFunction