Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Using the substring "[]" function, backwards

1 view
Skip to first unread message

Dupuis2387

unread,
Oct 30, 2006, 2:04:52 PM10/30/06
to
Hello all,

I am having some issues using the substring function in Basic syntax.

I want to get the substring of a string, but backwards.
Example:

VAR = "C:\Directory\Subfolder\finalplace\file.txt"

VAR2 = VAR[-1, 8]


to get var2="file.txt"

That doesn't work for some reason, all I get is the "t". Am I using it
wrong or what?

any help is appreciated.
thanks!

Dupuis2387

unread,
Oct 30, 2006, 2:32:08 PM10/30/06
to
NVM guys, I got it...weird too...

when its a negative , the first number dictates how far back left, from
right, to go, and set the initial point, then the second number, starts
at that new init point and goes back right.
so the answer I was seeking would be

VAR2=VAR[-8,8]

Later Days!

0 new messages