Home
   News/Alerts
   Hacks
   Source Code
       c/c++
       php
       dos
   Contact Me

HackHawk.net Source Code

The source code contained in this area is provied without any restrictions and without any warranty. I hope that it will be useful to others that stumble onto this web site. Please feel free to send any feedback or questions you may have to me at [hh@hackhawk.net].

     [  c/c++ functions  |  php functions  |  dos functions  ]
Substring DOS function

This is just an example of how to extract a substring from a DOS variable.

This example sets a string to be "One Long String", then extracts the characters starting at 5 with a lenght of 4, returning the string "Long".


@ECHO OFF
REM **** Dos Extract Substring Example...

SET LONG=One Long String
SET SHORT=%LONG:~4,4%

ECHO Long String is [%LONG%]
ECHO Short String is [%SHORT%]



Web Hosting by OP River