20230224 1309
동기) 문자열에서 특정 문자가 여러 번 나올 경우 맨 마지막 위치를 찾고 싶다.
(예) 년월일 포맷에서 날짜만 뽑기
zstr:="2002-08-09"
ans:=InStr(zstr,"-",,0)
ans1:=StrLen(zstr)
zcount:=ans1-ans
StringMid, zoutput, zstr, ans+1, zcount+1
MsgBox,% ans ", " ans1 ", " zcount ", " zoutput
return
^ESC:: ExitApp
결과
(note) 파일 경로에서 파일 이름만 추출하고 싶다면 간단하게 SplitPath 함수를 쓰면 된다.
; https://www.autohotkey.com/docs/v1/lib/SplitPath.htm
ztmp:="c:\aaa\bbb\ccc.txt"
SplitPath, ztmp, zfile
MsgBox,% zfile
return
^ESC:: ExitApp
ExitApp
'[PA] 업무자동화 > [AH]Autohotkey' 카테고리의 다른 글
AH GUI Text font 색깔 바꾸기 (0) | 2023.02.28 |
---|---|
AH generating GUI using Loop (0) | 2023.02.28 |
AH 윈도우 목록 보여주기 (0) | 2022.12.24 |
AH windows 정렬 organize tile size (0) | 2022.12.12 |
AH Gui Text 색깔 바꾸기 color change (0) | 2022.06.02 |