Variable missing from path

im trying to use a variable in a path and it ends up disappearing in the path.

im loading an image with
“…/folder/”+var1+"/images/icon.jpg"

and in the output i get …/folder//images/icon.jpg

and im loading the variables with

this.load(“var.txt”);

var.txt contents:
var1=1

any suggestions?