Home Whiteboard Online Compilers Practice Articles Tools
Library Courses Certifications Login
Batch Script Tutorial
  • Batch Script - Home
  • Batch Script - Overview
  • Batch Script - Environment
  • Batch Script - Commands
  • Batch Script - Files
  • Batch Script - Syntax
  • Batch Script - Variables
  • Batch Script - Comments
  • Batch Script - Strings
  • Batch Script - Arrays
  • Batch Script - Decision Making
  • Batch Script - Operators
  • Batch Script - DATE & TIME
  • Batch Script - Input / Output
  • Batch Script - Return Code
  • Batch Script - Functions
  • Batch Script - Process
  • Batch Script - Aliases
  • Batch Script - Devices
  • Batch Script - Registry
  • Batch Script - Network
  • Batch Script - Printing
  • Batch Script - Debugging
  • Batch Script - Logging
  • Batch Script - Quick Guide
  • Batch Script - Useful Resources
  • Batch Script - Discussion
  • Selected Reading
  • UPSC IAS Exams Notes
  • Developer's Best Practices
  • Questions and Answers
  • Effective Resume Writing
  • AI Based Resume Builder
  • Personal AI Study Assistant
  • Generate Coding Logic
  • HR Interview Questions
  • Computer Glossary
  • Who is Who

Batch Script - Remove All Spaces



Previous
Quiz
Next

This is used to remove all spaces in a string via substitution.

Example

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

set str=%str:=% 
echo %str%

The key thing to note about the above program is, the : = operator is used to remove all spaces from a string.

Output

The above command produces the following output.

This string    has    a  lot  of spaces
Thisstringhasalotofspaces
batch_script_strings.htm
Print Page
Previous
Next
Advertisements
TOP TUTORIALS
  • Python Tutorial
  • Java Tutorial
  • C++ Tutorial
  • C Programming Tutorial
  • C# Tutorial
  • PHP Tutorial
  • R Tutorial
  • HTML Tutorial
  • CSS Tutorial
  • JavaScript Tutorial
  • SQL Tutorial
TRENDING TECHNOLOGIES
  • Cloud Computing Tutorial
  • Amazon Web Services Tutorial
  • Microsoft Azure Tutorial
  • Git Tutorial
  • Ethical Hacking Tutorial
  • Docker Tutorial
  • Kubernetes Tutorial
  • DSA Tutorial
  • Spring Boot Tutorial
  • SDLC Tutorial
  • Unix Tutorial
CERTIFICATIONS
  • Business Analytics Certification
  • Java & Spring Boot Advanced Certification
  • Data Science Advanced Certification
  • Cloud Computing And DevOps
  • Advanced Certification In Business Analytics
  • Artificial Intelligence And Machine Learning
  • DevOps Certification
  • Game Development Certification
  • Front-End Developer Certification
  • AWS Certification Training
  • Python Programming Certification
COMPILERS & EDITORS
  • Online Java Compiler
  • Online Python Compiler
  • Online Go Compiler
  • Online C Compiler
  • Online C++ Compiler
  • Online C# Compiler
  • Online PHP Compiler
  • Online MATLAB Compiler
  • Online Bash Terminal
  • Online SQL Compiler
  • Online Html Editor
  • ABOUT US
  • OUR TEAM
  • CAREERS
  • JOBS
  • CONTACT US
  • TERMS OF USE
  • PRIVACY POLICY
  • REFUND POLICY
  • COOKIES POLICY
  • FAQ'S
tutorials point logo
Download Android App Download IOS App

Tutorials Point is a leading Ed Tech company striving to provide the best learning material on technical and non-technical subjects.

© Copyright 2025. All Rights Reserved.