Bob*_*Bob 2 windows cmd batch-file
我想从字符串的末尾提取字符.
SETLOCAL EnableDelayedExpansion
SET str=123456789abcdefgh
FOR /l %%x IN (1, 1, 10) DO (
ECHO %%x
SET result=%%str%:~-%%x%
ECHO "Extracted characters: " !result!
)
ENDLOCAL
Run Code Online (Sandbox Code Playgroud)
这是我错误的输出:
1
"提取的字符:"%str:〜-1
2
"提取的字符:"%str:〜-2
| 归档时间: |
|
| 查看次数: |
961 次 |
| 最近记录: |