联盟域名:www.cn-dos.net 论坛域名:www.cn-dos.net/forum DOS,代表着自由开放与发展,我们努力起来,学习FreeDOS和Linux的自由开放与GNU精神,共同创造和发展美好的自由与GNU GPL世界吧!
CODE: [Copy to clipboard]@echo off call:ReversOut "12345&6" strs ::这种方法兼容特殊字符 set/p "tt=%strs%"<nul echo\&pause exit :: /*-------ReversOut-------------- :ReversOut ["string"] [string] setlocal ENABLEEXTENSIONS set "str=%~1" :ReversOut_1 set "strs=%str:~0,1%%strs%" set "str=%str:~1%" if defined str goto:ReversOut_1 endlocal&set "%2=%strs%"&goto:eof :: ---------ReversOut------------*/
CODE: [Copy to clipboard]@echo off call:ReversOut "1234&56" strs ::这种方法兼容特殊字符,但会过滤引号。 set/p "tt=%strs%"<nul echo\&pause ::子过程用for会对!过来,用goto+call,set可以不过滤但速度慢了。 :: /*-------ReversOut-------------- :ReversOut ["string"] [string] setlocal enabledelayedexpansion set "str=%~1"&set "s=" for /l %%a in (200 -1 0)do if not "!str:~%%a,1!"=="" set s=!s!!str:~%%a,1! endlocal&set "%2=%s%"&goto:eof :: ---------ReversOut------------*/
CODE: [Copy to clipboard]@echo off call:ReversOut "12345&6" strs ::这种方法兼容特殊字符,但会过滤引号。 set/p "tt=%strs%"<nul :: /*-------ReversOut-------------- :ReversOu ["string"] [string] setlocal ENABLEEXTENSIONS set "str=%~1" :ReversOut_1 set "strs=%str:~0,1%%strs%" set "str=%str:~1%" if defined str goto:ReversOut_1 endlocal&set "%2=%strs%"&goto:eof :: ---------ReversOut------------*/