Display two characters and the characters between them

Time:2021-1-17
Copy codeThe code is as follows:
: for example, if I input AF, it will be displayed
::a
::b
::c
::d
::e
::f
I don’t know if it can be realized

@echo off
::
::
:begin
cls
set str=a b c d e f g h i j k l m n o p q r s t u v w x y z
set input=
Set / P input = please input the letter range (e.g. AF)
call set str=%%str:%input:~0,1%=-☆%input:~0,1%%%
call set str=%%str:%input:~-1%=%input:~-1%☆%%
for /f “tokens=2 delims=☆” %%i in (“%str%”) do set str=%%i
for %%i in (%str%) do echo %%i
pause
goto begin

@echo off
::
::
set str=a b c d e f g h i j k l m n o p q r s t u v w x y z
:begin
cls
set flag=0
set var=
set input=
Set / P input = please input the letter range (e.g. AF)
for %%i in (%str%) do call :pickup %%i

:end
pause
goto begin

:pickup
if /i “%1″==”%input:~0,1%” set flag=1
if /i “%1″==”%input:~-1%” set flag=2
if %flag% equ 1 echo %1
if %flag% equ 2 echo %1&goto end
goto :eof

@echo off
: encode each element of the string first, and then convert
::
::
setlocal enabledelayedexpansion

set str=a b c d e f g h i j k l m n o p q r s t u v w x y z
for %%i in (%str%) do set/a dec+=1 & set %%i=!dec! & set str!dec!=%%i
set en=
Set / P en = please input letter range (e.g. AF)
set/a num1=!%en:~0,1%!,num2=!%en:~-1%!
for /l %%i in (%num1%,1,%num2%) do echo !str%%i!
pause>nul
goto :eof

@echo off
: it is realized by comparing the size of the internal encoding of characters, which has great limitations
::
::
setlocal enabledelayedexpansion

set str=a b c d e f g h i j k l m n o p q r s t u v w x y z
set en=
Set / P en = please input letter range (e.g. AF)
set str1=%en:~0,1%
set str2=%en:~-1%
for %%i in (%str%) do if %%i geq !str1! if %%i leq !str2! echo %%i
pause>nul
goto :eof

@echo off
Disadvantages: the speed is slow
::
::
:begin
Set / p a = old rules, hee hee:
set str=a b c d e f g h i j k l m n o p q r s t u v w x y z
for %%i in (%str%) do echo %%i|findstr [%a:~0,1%-%a:~-1%]
pause
goto begin