for Windows10,Windows8,Windows7,VISTA,
XP,NT,Server 2000,Server 2003,Server 2008
Home
Source Script
Batch Files
Functions
Function Library
Script Snippets
Interfacing
Tips and Tricks
Copy Tips
Menu in Batch
String Manipulation
String Operations
Date and Time
Arithmetic
FTP Batch Script
Command Index
Tutorials
My First Batch
Solid Framework
Functions
Persistency
Forum
General
Terms of Use
Enablers
About Us
Contact Us
Others
Want donate a cup of Cafe? . click .
Remove both Ends
Remove the first and the last character of a string.
Description:
Using
:~1,-1
within a variable expansion will remove the first and last character of the string.
Script:
1.
2.
3.
4.
set str=politic
echo.%str%
set str=%str:~1,-1%
echo.%str%
Script Output:
Script Output
politic oliti