# how can i convert data into string format? [duplicate]

I have nested-lists in number format,like

 data={{1,2,3},{2,{3,4,50}},{4,5,6},{3,{3,{5,6}}}}


I want to convert each number into String format.For that purpose I tried the following code,but it doesn't working.

case1 :

 stringData=ReplaceAll[data, Identity -> String]


case2:

stringData= MapAll[ToString, data]

Testcase 1:

Part[stringData, 1, 2] + 10


I evaluated testcase,but it showing 12.

How can I solve this?

feel free,If you want to edit my question.

-

## marked as duplicate by Oleksandr R., Jens, Sjoerd C. de Vries, Yves Klett, m_goldbergMar 15 '13 at 13:47

Look at the docs for ToString. –  whuber Mar 14 '13 at 16:25

Building on your first try, an alternative to acl's approach is

l = {{1, 2, 3}, {2, {3, 4, 50}}, {4, 5, 6}, {3, {3, {5, 6}}}};
ReplaceAll[l, n_Integer :> ToString[n]]


which gives

{{"1", "2", "3"}, {"2", {"3", "4", "50"}}, {"4", "5", "6"}, {"3", {"3", {"5", "6"}}}}

-

Does Map like this

Map[
ToString[#] &,
{{1, 2, 3}, {2, {3, 4, 50}}, {4, 5, 6}, {3, {3, {5, 6}}}},
{-1}
]


do what you want?

-
Why do you use ToString[#] &, instead of just ToString? –  Sjoerd C. de Vries Mar 14 '13 at 16:35
@SjoerdC.deVries to annoy MrW with my lack of brevity :) –  acl Mar 14 '13 at 16:38
@acl Ah, then why not Function[string, ToString[string]][#]& :P –  The Toad Mar 14 '13 at 17:16
@rm-rf He ought then to prefer ToString[#] & @# &@# &@# &@# &@# &@# &@# &@# &@# &. Oh, sorry, that's too compact: how about ToString[#] &[#] &[#] &[#] &[#] &[#] &[#] &[#] &[#] &[#] &[#] & instead? :-) –  whuber Mar 14 '13 at 17:21
Oh gads, I've been sniped. I was about to comment on the unnecessary Function in ToString[#] & and then I saw the comments. I hate you for the next 13.7 minutes. ;-p –  Mr.Wizard Mar 14 '13 at 18:42