RE: need help decompose word

2003-08-29 Thread Kevin Pfeiffer
Hi, In article <[EMAIL PROTECTED]>, Rob Hanson wrote: > Just to throw out another idea, you can also do this... > > my $name = "Anthony Bob"; > my @letters = grep {!/\s/} split('', $name); > > # to test > print "@letters"; > > It also looks like you wanted upper case. You can do that with thi

Re: need help decompose word

2003-08-18 Thread Bernhard van Staveren
> my $text = ' Anthony Bob '; > > my @letters = $text =~ /[[:alpha:]]/g; > > print "$_\n" for @letters; This works too (at least, works for me): my $text='Anthony Bob'; my @letters=split(//, $text); print(join("\n", @letters)); -- Bernhard van Staveren - madcat(at)ghostfield.com GhostField

RE: need help decompose word

2003-08-18 Thread Bob Showalter
John W. Krahn wrote: > ... > my @letters = $text =~ /[[:alpha:]]/g; I never knew you could leave the parens off in a case like this. I just went and looked it up. Neat! -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: need help decompose word

2003-08-18 Thread John W. Krahn
Awards wrote: > > Hi, Hello, > I have no idea how to do this. > I have a name > Anthony Bob > I want to put each letter in an array (no space) > for(0..$numbersofletters){ > @letters[c]= A LETTER > } > so when i do print @letters i get > A > N > T > H > O > N > Y > B > O > B > something like tha

RE: need help decompose word

2003-08-18 Thread Bob Showalter
awards wrote: > Hi, > > I have no idea how to do this. > I have a name > Anthony Bob > I want to put each letter in an array (no space) > for(0..$numbersofletters){ > @letters[c]= A LETTER > } > so when i do print @letters i get > A > N > T > H > O > N > Y > B > O > B > something like that, any he

RE: need help decompose word

2003-08-18 Thread Hanson, Rob
my @letters = grep {!/\s/} split('', uc($name)); In both cases the split cuts it up into a list of characters, and grep filters out the spaces (also newlines & tabs). Rob -Original Message- From: awards [mailto:[EMAIL PROTECTED] Sent: Monday, August 18, 2003 11:30 AM To: [E

RE: need help decompose word

2003-08-18 Thread Dan Muey
> Hi, Howdy > > That is quite simple. I tought it would be more difficult > than that :-) > It's cuz Perl rocks!! > Thank you both of you > Anthony > > > > -- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > -- To unsubscribe, e-mail

Re: need help decompose word

2003-08-18 Thread awards
Hi, That is quite simple. I tought it would be more difficult than that :-) Thank you both of you Anthony -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: need help decompose word

2003-08-18 Thread James Edward Gray II
On Monday, August 18, 2003, at 10:29 AM, awards wrote: Hi, I have no idea how to do this. I have a name Anthony Bob I want to put each letter in an array (no space) my $name = 'Anthony Bob'; $name =~ tr/ //d; # remove the space my @letters = split //, $name; for(0..$numbersofletter

RE: need help decompose word

2003-08-18 Thread Dan Muey
> Hi, Howdy, > > I have no idea how to do this. > I have a name > Anthony Bob > I want to put each letter in an array (no space) > for(0..$numbersofletters){ @letters[c]= A LETTER } so when i > do print @letters i get A N T H O N Y B O B something like > that, any help is appreciated. Anthony

need help decompose word

2003-08-18 Thread awards
Hi, I have no idea how to do this. I have a name Anthony Bob I want to put each letter in an array (no space) for(0..$numbersofletters){ @letters[c]= A LETTER } so when i do print @letters i get A N T H O N Y B O B something like that, any help is appreciated. Anthony -- To unsubscribe, e-mail