String element with combined variables

String element with combined variables

I have a state String thats dependable on 3 variables (X1, X2, X3). Ex.:
X1=4, X2=1, X3= 5 Then string is 'Idle Connected'.
What would best way to achieve this?