0
我正在使用Autohotkey。在Autohotkey中刪除特定字符後的字符
我有這個字符串變量ABCDEF.XX
。我想通過去除.
之後的字符(包括.
本身)將其轉換爲ABCDEF
。
inputVar:="ABCDEF.XX"
StringTrimRight, inputVar, inputVar, 3
如果我想讓代碼識別點的位置,該怎麼辦?並相應地刪除字符。如何才能做到這一點?
我正在使用Autohotkey。在Autohotkey中刪除特定字符後的字符
我有這個字符串變量ABCDEF.XX
。我想通過去除.
之後的字符(包括.
本身)將其轉換爲ABCDEF
。
inputVar:="ABCDEF.XX"
StringTrimRight, inputVar, inputVar, 3
如果我想讓代碼識別點的位置,該怎麼辦?並相應地刪除字符。如何才能做到這一點?
inputVar:="ABCDEF.XX"
StringSplit, input_array, inputVar, .
MsgBox, %input_array1%
https://autohotkey.com/docs/commands/StringSplit.htm#Examples
或
FileName :="ABCDEF.XX"
SplitPath, FileName,,,,name_no_ext
MsgBox, %name_no_ext%
https://autohotkey.com/docs/commands/SplitPath.htm
或
Remove last n characters of string after the dot with Autohotkey