CopyCode The Code is as follows:
:
: B
: C
: D
: E
: F
: Each letter occupies a line. ''I wonder if it can be implemented ..
@ 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 = enter a letter range (such as 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 = enter a letter range (such as 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 before conversion.
::
::
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 = enter a letter range (for example, 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 achieved by comparing the internal encoding size of characters, with 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 = enter a letter range (for example, 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
: Disadvantage: Slow speed
::
::
: Begin
Set/p a = "Old rule :"
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 [% :~ 0, 1%-% :~ -1%]
Pause
Goto begin