Scan
StringArray = Scan ( String AS String , Pattern AS String )
将String字符串与模板Pattern字符串对照匹配,并且返回一个保存着与'*'通配符关联的字符串的字符串数组。
-
String是被比较字符串。
-
Pattern是模板字符串,相关描述在LIKE。
示例
Dim sResult AS String
Dim sLine AS String
Dim sElt AS String
Exec ["df"] To sResult
For Each sLine In Split(sResult, "\n")
For Each sElt In Scan(sLine, "* * * * *")
Print sElt; "|";
Next
Print
Next
Filesystem|Size|Used|Avail|Use%|Mounted on|
/dev/hda6|8.0G|3.8G|4.3G|47%|/|
/dev/hda5|31M|3.3M|26M|12%|/boot|
/dev/hda8|33G|31G|1.2G|97%|/home|
/dev/hda1|8.1G|4.1G|4.0G|51%|/mnt/win_c|
/dev/hda9|29G|27G|1.1G|97%|/mnt/win_d|
none|379M|52K|379M|1%|/tmp|
参见