MathGroup Archive 2005

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Re: String to list

  • To: mathgroup at smc.vnet.net
  • Subject: [mg60980] Re: [mg60950] Re: String to list
  • From: Bob Hanlon <hanlonr at cox.net>
  • Date: Thu, 6 Oct 2005 04:08:22 -0400 (EDT)
  • Reply-to: hanlonr at cox.net
  • Sender: owner-wri-mathgroup at wolfram.com

Str="Hi every one!";

Also, new in Version 5.1

StringSplit[Str]

{Hi,every,one!}


Bob Hanlon

> 
> From: "Jens-Peer Kuska" <kuska at informatik.uni-leipzig.de>
To: mathgroup at smc.vnet.net
> Date: 2005/10/05 Wed AM 02:27:51 EDT
> Subject: [mg60980] [mg60950] Re: String to list
> 
> Hi,
> Str = "Hi every one!";
> Characters[Str]
> 
> gives
> 
> {H, i, , e, v, e, r, y, , o, n, e, !}
> 
> and
> 
> Characters[
> Str] //. {{d___, Null ..., a__String, " ", b___} 
> :> {d, Null,
> StringJoin[a], Null, b},
> {a___, Null, b__String} :> {a, Null, 
> StringJoin[b]}} /.
> Null :> Sequence[]
> 
> gives
> 
> {Hi, every, one!}
> 
> and
> 
> ImportString[Str, "List"]
> 
> and
> 
> ImportString[Str, "Words"]
> 
> gives also
> 
> {Hi, every, one!}
> 
> Regards
> 
>   Jens
> 
> "Sara" <ma_sara177 at hotmail.com> schrieb im 
> Newsbeitrag news:dht4il$ho4$1 at smc.vnet.net...
> | How can I transform a string to a list??
> | example:
> | Str="Hi every one!"  and the list af str=?????
> | 
> 
> 
> 


  • Prev by Date: Re: Finding length in recursive definition?
  • Next by Date: Assigning (really dumb question)
  • Previous by thread: Re: String to list
  • Next by thread: the faster way to find repeated sublists