OK, so basically I need a small snippet to help me insert a character into a string. Let's take the following string for instance:
HelloWorld
I want to go to the 5th position in the string from the right and insert a space returning:
Hello World
Also, it has to work with a variable, e.g. I store the number "5" into a variable:
set posInStr=5
and then use that variable to place a character in the string at that variable's position. In total, what I'm picturing is something like this:
CODE
set myVar=HelloWorld
set posInStr=5
#:: Break String Into 2 Variables At The 5th Position Here
#:: We'll Call Them "strA" and "strB"
echo %strA% %strB%
As you can see, all I need is the code on how to harvest a string based on a variable. I know about:
%variable:~start,end%
however, I can't get it to work with a variable position, e.g.
%variable:~start,%posInStr %%
This post has been edited by Master Jake: 14 Oct, 2009 - 08:22 AM