yes, I have some address E: \ \ xx xx ini how to get rid of E: \ \, xx is \ and \ front part
CodePudding user response:
I'm sorry, this I use c #, VB, not apply to can't help you, really sorry,
CodePudding user response:
For "" can be used to remove shift character @ said,
For example, a path: E: \ Test1 and Test2, using the @ "E: \ Test1 and Test2" when the program is run by the program read the string is: "E: Test1 Test2",
CodePudding user response:
S=split (" E: \ \ xx xx ini ", "")
Msgbox s (ubound (s))
CodePudding user response:
Use InStrRev () and Mid $() function,
Dim s $, i&
S="E: \ \ xx xx ini" I=InStrRev (s, "") 'to get the position of the last \ characters (s, s=Mid $I + 1) 'capture finally that string
CodePudding user response:
Private Sub Form_Load () As Integer Dim XX As A String, A, B As Integer XX="E: \ \ XX, XX, XX, XXX, XXX, AA. Ini" B=Len (XX) 'get the length of the string A=InStrRev (XX, "") to detect the location of the last "", XX, XX=Right (B - A) 'intercept string B - A position behind the string 'last variable is XX "AA. Ini", suitable for path no matter how long, all can get the file name + extension End Sub
CodePudding user response:
The split. Can solve
CodePudding user response:
The original poster is to get the directory, reverse lookup is positive solution,
Dim s $, i& S="E: \ \ xx xx ini" MsgBox Left (s, InStrRev (s, ""))
CodePudding user response:
Said those with Split, are "as long as they can out of the results, regardless of efficiency",