Code: Select all
username := "ya64ug , tag = 78"
MsgBox, %username%
tmp := StrSplit(username, " ")
tmp_last := % tmp.MaxIndex()
MsgBox, %tmp_last%
tag := tmp%tmp_last%
MsgBox, %tag%
Code: Select all
username := "ya64ug , tag = 78"
MsgBox, %username%
tmp := StrSplit(username, " ")
tmp_last := % tmp.MaxIndex()
MsgBox, %tmp_last%
tag := tmp%tmp_last%
MsgBox, %tag%
Code: Select all
username := "ya64ug , tag = 78"
array := StrSplit(username, " ")
msgbox, % array[array.Count()]
; => 78
Code: Select all
username := "ya64ug , tag = 78"
array := StrSplit(username, " ")
msgbox, % array.pop()
; => 78
;array is now ["ya64ug", "", "", ",", "", "tag", "="]
Code: Select all
A := new biga() ; requires https://www.npmjs.com/package/biga.ahk
username := "ya64ug , tag = 78"
array := StrSplit(username, " ")
msgbox, % A.last(array)
; => 78
Code: Select all
username := "ya64ug , tag = 78"
MsgBox, %username%
tmp := StrSplit(username, " ")
tmp_last := tmp.MaxIndex()
MsgBox, %tmp_last%
tag := tmp[tmp_last]
MsgBox, %tag%
Code: Select all
username := "ya64ug , tag = 78"
MsgBox, %username%
tmp := StrSplit(RegExReplace(username, " +", " "), " ")
tmp_last := tmp.MaxIndex()
MsgBox, %tmp_last%
tag := tmp[tmp_last]
MsgBox, %tag%
Code: Select all
username := "ya64ug , tag = 78"
RegExMatch(username, "\S+$", tag)
MsgBox, %tag%