Copy link to clipboard
Copied
var num=12
var num1=33
var hm=apple
var al=orange
if var's has values:
var num=12
var num1=33
var hm=apple
var al=orange
this.getField("Text1").value="check"+num+" "+hm+" "+num1+" "+al+" with :"
i want this
check 12 apple 33 orange
but when i have
var num=""
var num1=33
var hm=""
var al=orange
check 33 orange
why var with "" system add space? how to add "nothing"
e.g.
check 33 orange
var text1 = "name:";
var text2 = "";
var text3 = text1;
if (text2 != "") text3 = text3 + " " + text2;
Copy link to clipboard
Copied
In your code you adds the spaces like this:
+" "+
Copy link to clipboard
Copied
Yes because on this e.g
check 12 apple 33 orange
Must have +" "+
Copy link to clipboard
Copied
Add the space only when you add non-empty text.
Copy link to clipboard
Copied
How to create that? Any example please?
Copy link to clipboard
Copied
var text1 = "name:";
var text2 = "";
var text3 = text1;
if (text2 != "") text3 = text3 + " " + text2;