- Batch Script - Logging
- Batch Script - Debugging
- Batch Script - Printing
- Batch Script - Network
- Batch Script - Registry
- Batch Script - Devices
- Batch Script - Aliases
- Batch Script - Process
- Batch Script - Functions
- Batch Script - Return Code
- Batch Script - Input / Output
- Batch Script - DATE & TIME
- Batch Script - Operators
- Batch Script - Decision Making
- Batch Script - Arrays
- Batch Script - Strings
- Batch Script - Comments
- Batch Script - Variables
- Batch Script - Syntax
- Batch Script - Files
- Batch Script - Commands
- Batch Script - Environment
- Batch Script - Overview
- Batch Script - Home
Batch Script Resources
Selected Reading
- Who is Who
- Computer Glossary
- HR Interview Questions
- Effective Resume Writing
- Questions and Answers
- UPSC IAS Exams Notes
Batch Script - Strings
In DOS, a string is an ordered collection of characters, such as "Hello, World!".
S.No | Strings & Description |
---|---|
1 | A string can be created in DOS in the following way. |
2 | Empty String |
3 | String interpolation is a way to construct a new String value from a mix of constants, variables, pterals, and expressions by including their values inside a string pteral. |
4 | You can use the set operator to concatenate two strings or a string and a character, or two characters. Following is a simple example which shows how to use string concatenation. |
5 | In DOS scripting, there is no length function defined for finding the length of a string. There are custom-defined functions which can be used for the same. Following is an example of a custom-defined function for seeing the length of a string. |
6 | A variable which has been set as string using the set variable can be converted to an integer using the /A switch which is using the set variable. The following example shows how this can be accomppshed. |
7 | This used to apgn text to the right, which is normally used to improve readabipty of number columns. |
8 | This is used to extract characters from the beginning of a string. |
9 | This is used to extract a substring via the position of the characters in the string. |
10 | The string substitution feature can also be used to remove a substring from another string. |
11 | This is used to remove the first and the last character of a string. |
12 | This is used to remove all spaces in a string via substitution. |
13 | To replace a substring with another string use the string substitution feature. |
14 | This is used to extract characters from the end of a string. |