Batch Script - Empty String Last Updated : 19 Dec, 2021 Summarize Comments Improve Suggest changes Share Like Article Like Report In this article, we are going to create an Empty String using Batch Script. Batch Script :@echo off set str1= set str2=Hello ::using if statement we will check that str1 is empty string or not. if [%str1%]==[] echo "str1 is an empty string" if [%str2%]==[] echo "str2 is an empty string" pauseExplanation :By using ' set ' we are getting our input string.str1 with no value (i.e Empty string)and str2 as 'Hello'Now using the if statement we will check whether str1 is an empty string or not. if [%str1%]==[] echo "str1 is an empty string" :: parenthesis is insecure always, so always use square brackets. A double colon (::) is used to add any comment in any batch script.Then we are using 'pause', to hold the screen until any key is pressed, so that we can read our output.as we can see our str1 is empty string As we can clearly see that 'str1 is an empty string' is printed as output which means our if statement is True for the str1 argument. Hence str1 is an empty string. Comment More infoAdvertise with us Next Article Batch Script - Empty String T thenavneet Follow Improve Article Tags : Linux-Unix Batch-script Similar Reads Batch Script - Left String In this article, we are going to study Left string in Batch Script. In Batch Script, the Left string is used to extract the characters from the beginning of the string by giving position 0 and a length using:~ while expanding a variable content. Example 1: Batch script set str=GeeksForGeeks echo.%st 1 min read Batch Script - Mid String In this article , we are going to learn how to use the concept of Mid String using Batch Script. Using the concept of 'Mid String' we are extracting out a sub string between two indices of any given string. Batch Script :@echo off set str=GeeksforGeeks echo %str% set str=%str:~5,-5% echo %str% pause 2 min read Batch Script - String length In this article , we are going to learn how to find length of any String using Batch Script. Batch Script :@echo off set str=Geeks For Geeks call :strLen str strlen echo String is %strlen% characters long pause exit /b :strLen setlocal enabledelayedexpansion :strLen_Loop if not "!%1:~%len%!"=="" set 2 min read Batch Script - Create String In this article, we are going to learn how to create a String using Batch Script. Batch Script :@echo off set str=Geeks for Geeks echo %str% pauseBy using ' set ' we are getting input of any string.Ex: set str=input stringIn the next line, we are using ' echo %str% ' for printing our input string.Th 1 min read Batch Script - Strings A Bash script is a plain text file. This file contains different commands for step-by-step execution. These commands can be written directly into the command line but from a re-usability perceptive it is useful to store all of the inter-related commands for a specific task in a single file. We can u 4 min read Like