我正在使用Autohotkey。
我有这个字符串变量ABCDEF.XX
。我想通过剥离ABCDEF
.
之后的字符来将其转换为.
。
inputVar:="ABCDEF.XX"
StringTrimRight, inputVar, inputVar, 3
如果我希望代码识别点的位置,该怎么办?并相应地删除字符。怎么办呢?
答案 0 :(得分:1)
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