2013-10-29 133 views
0

我有一個這樣的字符串:AutoIt的分割字符串

Info1|Info2 

我想這串,劈裂|它應該返回第二個Info和第一個。 所以我想要一個msgbox顯示Info1,另一個顯示Info2。 我該怎麼做? 我已經嘗試過

StringSplit

但沒有任何成功...

回答

2

試試這個:

#Region ;************ Includes ************ 
#Include <Array.au3> 
#EndRegion ;************ Includes ************ 
$str = 'Info1|Info2' 
$array = StringSplit($str, '|', 2) 
For $i = 0 To UBound($array) - 1 
    MsgBox(64, $i, $array[$i], 1) 
Next 
_ArrayDisplay($array) ; example