Mathematica 9 is now available
Student Support Forum
-----
Student Support Forum: 'strings' topicStudent Support Forum > General > "strings"

Next Comment >Help | Reply To Topic
Author Comment/Response
sheila
05/24/10 03:51am

hello all

I'm stuck with converting a list of characters to strings. I've tried loads of things but here is the basic problem

In[48]:= lis5 = Permutations[{0, 0, 0, 0, 0, 1, 1, 1, 1, 1}, {10}];

In[51]:= StringJoin[lis5[[1]]]

During evaluation of In[51]:= StringJoin::string: String expected at position 1 in 0<>0<>0<>0<>0<>1<>1<>1<>1<>1. >>

During evaluation of In[51]:= StringJoin::string: String expected at position 2 in 0<>0<>0<>0<>0<>1<>1<>1<>1<>1. >>

During evaluation of In[51]:= StringJoin::string: String expected at position 3 in 0<>0<>0<>0<>0<>1<>1<>1<>1<>1. >>

During evaluation of In[51]:= General::stop: Further output of StringJoin::string will be suppressed during this calculation. >>

Out[51]= 0 <> 0 <> 0 <> 0 <> 0 <> 1 <> 1 <> 1 <> 1 <> 1

In[52]:= ToString[%]

Out[52]= "0<>0<>0<>0<>0<>1<>1<>1<>1<>1"

I want each 10 digit permutation in the list to become a string which I can manipulate. So really, I want to get rid of the 'commas' but keep the 10 digit strings separate.

I wonder if anyone can help? Greatly appreciated.Sheila

URL: ,

Subject (listing for 'strings')
Author Date Posted
strings sheila 05/24/10 03:51am
Re: strings TomD 05/25/10 07:27am
Re: strings yehuda ben-s... 05/25/10 4:49pm
Next Comment >Help | Reply To Topic