Reputation: 415
I am concatenating a variable onto a path(string), i'm using a message box to display this for testing purposes, I can see that the variable is starting on a new line, which in turn when i try to open the file it doesn't recognize that the file exist...
Dim Path As String = "C:\Users\stefan\Desktop\Uni Work\Year 4\Projects\Project Selection\Project\Project\bin\Debug\"
Shapetext = clickedShapes.Item(nextShape).Text.ToString.Substring(0, clickedShapes.Item(nextShape).Text.IndexOf(" "))
MsgBox(Path + Shapetext + ".txt")
can any1 help me out here?
Upvotes: 0
Views: 58
Reputation: 156
On your final output string, you could always use something like
string.replace(vbCrLf, "")
or
string.replace(vbCr, "")
Upvotes: 0
Reputation: 216273
I suggest to:
At this point will be obvious what's wrong. Or file doesn't exist, or your string concat fails for some reason.
Upvotes: 2