:unittest.Trim :$created 20080227 :$changed 20080227 :$source https://www.dostips.com for %%C in ( "trim nothing" " trim one left and one right " " trim plenty left and right " ) do ( set "s=%%~C" call:Trim s call:Format "[35] [35]." "'%%~C'" "'%%s%%'" ) EXIT /b
Script Output:
Script Output
---- :unittest.Trim - output
'trim nothing' 'trim nothing' .
' trim one left and one right ' 'trim one left and one right' .
' trim plenty left and right ' 'trim plenty left and right' .
----