AutoIt Split String

跟風遠走 提交于 2019-12-13 04:40:06

问题


I have a String like this:

Info1|Info2

I want this String to be splitted by | and a it should return the second Info and the first one. So I want one msgbox displaying Info1 and another one displaying Info2. How can I do this? I already tried

StringSplit

But without any success...


回答1:


Try this :

#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


来源:https://stackoverflow.com/questions/19661998/autoit-split-string

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!