trimspace в файле bact

@echo off 
set str = This string    has    a  lot  of spaces 
echo %str% 

set str=%str:=% 
echo %str%
Restu Wahyu Saputra