Code: Select all
set str=15 Trailing Spaces to truncate &rem
echo."%str%"
for /l %%a in (1,1,31) do if "!str:~-1!"==" " set str=!str:~0,-1!
echo."%str%"
and this is the output
"15 Trailing Spaces to truncate space space space "
"15 Trailing Spaces to truncate"
I have a variable string lenght to put in a fix 40 chars, as this example
"40 Trailing Spaces to fille"
"40 Trailing Spaces to fille space space space "
Space=blank
How can I achive this result?
Thank you in advance