Function to join variable names
The basic process is to turn the symbols into strings, join them together and then make a symbol again. However, if one of the symbols has a definition this won't work if you don't hold the evaluation of the symbols properly. The following function should work even for symbols that have definitions:
SetAttributes[symbolNameJoin, HoldAll];
symbolNameJoin[symbols__Symbol] := Symbol @ Apply[
StringJoin,
Map[
Function[s, ToString[Unevaluated[s]], HoldFirst],
Hold[symbols]
]
];
Example of use:
x = 1;
symbolNameJoin[x, y, z]
xyz