When I type
a <> "0" /. {a -> "1"}
I get the error
StringJoin::string: String expected at position 1 in a<>0. >>
Followed by the answer I want
"10"
What should I do instead so that I don't get the error?
Mathematica Stack Exchange is a question and answer site for users of Wolfram Mathematica. It only takes a minute to sign up.
Sign up to join this communityUse one of the following
a <> "0" /. {a -> "1"} // Quiet
or
ReleaseHold[Hold[a <> "0"] /. {a -> "1"}]
Make a lazier StringJoin:
stritch[a_String, b_String] := a <> b
stritch[a, "0"] /. a -> "1"
(* 10 *)