0
[SOLVED] How do I turn two variables like 1 and 2 into one variable 12.
4 Answers
+ 1
By Concatenating them.
example
int a = 1;
int b = 2;
int result = (int) (to_string(a) + to_string(b))
bob something like this.
+ 1
bob what language and have you an actual related question ? If so please post your code attempt here with somewhat clarity as to what the issue appears to be.
Thanks and happy coding.
0
Use concatination
var a = "1" ;
var b = "2" ;
var c = a+b ;
Console.log(c) ;
//-> 12
0
var a = 1 ;
var b = 2;
var c = a+""+b ;