I want to convert a list of digits to a string, for example from {1,2,3,4,5}
, I want to get the string 12345.
The following will work as long as the list does not begin with 0's:
{1, 2, 3, 4, 5} // FromDigits // ToString
Out[10]:= 12345
However if the list begins with 0's, as in
{0, 0, 1, 2, 3, 4} // FromDigits // ToString
Out[11]:= 1234
this method chops off the 0's in the front.
I could write a program that tests to see if the list begins with a string of 0's and then append that many zeros to the chopped off output, but I'd like a less procedural way of getting the string. Is this possible?
Note: the lists I want to convert are going to come from some prior computation, so unlike the above examples, I won't know their contents unless I explicitely examine them.
StringRiffle[{0, 0, 1, 2, 3, 4}, ""]
introduced in version 10.1 $\endgroup$