本帖最后由 水木子 于 2010-3-15 11:20 编辑
办法比较笨!#include <Array.au3>
Dim $avArray[8] = [12, 34, 56, 78, 12, 34, 56, 78], $z, $x = 1, $Text
$sText = '01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 01' & @CRLF & _
'00 00 00 00 00 00 00 00 00 00 00 00 00 00 00' & @CRLF & _
'01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 01'
MsgBox(0, '原字符串', $sText)
$sReg = StringRegExp($sText, '\w+', 3)
For $i = 18 To 25
$sReg[$i] = $avArray[$z]
$z += 1
Next
For $o = 0 To UBound($sReg) - 1
If StringIsInt($x / 15) Then
$Text &= $sReg[$o] & ' ' & @CRLF
Else
$Text &= $sReg[$o] & ' '
EndIf
$x += 1
Next
MsgBox(0, '替换结果', $Text)
|