Re: iterate chars in a string
- From: Lyndon Samson <lyndon.samson@xxxxxxxxx>
- Date: Wed, 21 Dec 2005 07:28:45 +0900
a="123"
0.upto(a.length) { |i| puts a[i..i] }
On 12/20/05, shinya <piccionevolante@xxxxxxxxx> wrote:
> Hi there!
> I'm a ruby newbie, and I'm searching for a way to iterate every char in
> a string, but I cannot find any easy way. My problem is to look at every
> char in a string and match it with some known letter.
> I use the String#each_byte iterator for now, but it still be a poor
> solution :/
> Thanks,
>
> shinya.
>
>
--
Into RFID? www.rfidnewsupdate.com Simple, fast, news.
.
- Follow-Ups:
- Re: iterate chars in a string
- From: Jeff Wood
- Re: iterate chars in a string
- References:
- iterate chars in a string
- From: shinya
- iterate chars in a string
- Prev by Date: Re: iterate chars in a string
- Next by Date: Re: [grammarians] shortcut to self.class ?
- Previous by thread: Re: iterate chars in a string
- Next by thread: Re: iterate chars in a string
- Index(es):
Relevant Pages
|