jeg har det herfra :
http://abstractvb.com/learn.asp?CID=87at man skulle kunne gøre sådan:
Not too tough is it? Well here is another one to try out. Lets say MyString = "c:\program files\games\abstract.exe" How would you get just the "abstract" portion of it? Well there are many ways to do this one, but since we haven't used that InStrRev function yet lets try it out:
Begining = (InStrRev(MyString, "\") + 1)
Ending = InStrRev(MyString, ".")
Length = Ending - Begining
NewString = Mid(MyString, Begining, Length)
That seems like quite a few steps just to get the word "abstract", but you put it all on one line so you don't have to use so many temporary variables, like this:
NewString = Mid(MyString, (InStrRev(MyString, "\") + 1), (InStrRev(MyString, ".") - (InStrRev(MyString, "\") + 1)))