Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.ruby > #3378 > unrolled thread
| Started by | Siratinee Sukachai <ploy.sukachai@gmail.com> |
|---|---|
| First post | 2011-04-22 05:52 -0500 |
| Last post | 2011-04-23 23:28 -0500 |
| Articles | 7 — 5 participants |
Back to article view | Back to comp.lang.ruby
Split dot and equa sign by recursive Siratinee Sukachai <ploy.sukachai@gmail.com> - 2011-04-22 05:52 -0500
Re: Split dot and equa sign by recursive Harry Kakueki <list.push@gmail.com> - 2011-04-23 07:04 -0500
Re: Split dot and equa sign by recursive Sira PS <ploy.sukachai@gmail.com> - 2011-04-23 12:36 -0500
Re: Split dot and equa sign by recursive Harry Kakueki <list.push@gmail.com> - 2011-04-23 22:19 -0500
Re: Split dot and equa sign by recursive Brian Candler <b.candler@pobox.com> - 2011-04-23 07:14 -0500
Re: Split dot and equa sign by recursive Ryan Davis <ryand-ruby@zenspider.com> - 2011-04-23 10:37 -0500
Re: Split dot and equa sign by recursive Sira PS <ploy.sukachai@gmail.com> - 2011-04-23 23:28 -0500
| From | Siratinee Sukachai <ploy.sukachai@gmail.com> |
|---|---|
| Date | 2011-04-22 05:52 -0500 |
| Subject | Split dot and equa sign by recursive |
| Message-ID | <834998812ddf8cd759b85d568ed321db@ruby-forum.com> |
I need to do a function which can split dot and equa by recursive.
But I don't have any ideas to do on recursive.
This is the example of my strings
Member.certPm=PM Certification
projects.risks.Index.flash_downloading=Downloading report, please wait..
The numbers of dot it is different. I need to split these strings and
set on hashes
Member => {certPm => PM Certification}
projects => {risks => {Index => {flash_downloading => Downloading
report, please wait..}}}
Do you have any guide for me to do this?
--
Posted via http://www.ruby-forum.com/.
[toc] | [next] | [standalone]
| From | Harry Kakueki <list.push@gmail.com> |
|---|---|
| Date | 2011-04-23 07:04 -0500 |
| Message-ID | <BANLkTi=UNJ2wjnMJdurvxprX02Ufk7Fu0Q@mail.gmail.com> |
| In reply to | #3378 |
On Fri, Apr 22, 2011 at 7:52 PM, Siratinee Sukachai
<ploy.sukachai@gmail.com> wrote:
> I need to do a function which can split dot and equa by recursive.
> But I don't have any ideas to do on recursive.
>
> This is the example of my strings
>
> Member.certPm=PM Certification
> projects.risks.Index.flash_downloading=Downloading report, please wait..
>
> The numbers of dot it is different. I need to split these strings and
> set on hashes
>
> Member => {certPm => PM Certification}
> projects => {risks => {Index => {flash_downloading => Downloading
> report, please wait..}}}
>
> Do you have any guide for me to do this?
>
> --
Do I understand this correctly?
You have a string like this,
"projects.risks.Index.flash_downloading=Downloading report, please wait.."
and you want to produce this,
projects => {risks => {Index => {flash_downloading => Downloading
report, please wait..}}}
Is that what you want to do?
Harry
[toc] | [prev] | [next] | [standalone]
| From | Sira PS <ploy.sukachai@gmail.com> |
|---|---|
| Date | 2011-04-23 12:36 -0500 |
| Message-ID | <8e294958eb82d297ac2b5515775a6443@ruby-forum.com> |
| In reply to | #3397 |
>
> Do I understand this correctly?
>
> You have a string like this,
>
> "projects.risks.Index.flash_downloading=Downloading report, please
> wait.."
>
> and you want to produce this,
>
> projects => {risks => {Index => {flash_downloading => Downloading
> report, please wait..}}}
>
> Is that what you want to do?
> Harry
Yes, that's what I want.
--
Posted via http://www.ruby-forum.com/.
[toc] | [prev] | [next] | [standalone]
| From | Harry Kakueki <list.push@gmail.com> |
|---|---|
| Date | 2011-04-23 22:19 -0500 |
| Message-ID | <BANLkTi=+x7QyPS8Gww7idFv1JgqY-iJNOw@mail.gmail.com> |
| In reply to | #3408 |
> Yes, that's what I want. > What have you tried so far? Harry
[toc] | [prev] | [next] | [standalone]
| From | Brian Candler <b.candler@pobox.com> |
|---|---|
| Date | 2011-04-23 07:14 -0500 |
| Message-ID | <c868d3e590cc9519d5b53016939a749c@ruby-forum.com> |
| In reply to | #3378 |
Siratinee Sukachai wrote in post #994481:
> I need to do a function which can split dot and equa by recursive.
> But I don't have any ideas to do on recursive.
Is this a homework question? Otherwise, why do you say you want to use a
recursive algorithm, but then say you don't know anything about
recursion?
A structure like :a => {:b => {:c => :d} } is nested. You do not need to
use recursion to build it.
--
Posted via http://www.ruby-forum.com/.
[toc] | [prev] | [next] | [standalone]
| From | Ryan Davis <ryand-ruby@zenspider.com> |
|---|---|
| Date | 2011-04-23 10:37 -0500 |
| Message-ID | <6F9D8A2A-F2C8-4621-A35C-78C1A394A598@zenspider.com> |
| In reply to | #3399 |
On Apr 23, 2011, at 5:14, Brian Candler <b.candler@pobox.com> wrote: > Is this a homework question? Otherwise, why do you say you want to use a > recursive algorithm, but then say you don't know anything about > recursion? Almost guaranteed. Google the email address.
[toc] | [prev] | [next] | [standalone]
| From | Sira PS <ploy.sukachai@gmail.com> |
|---|---|
| Date | 2011-04-23 23:28 -0500 |
| Message-ID | <1e4881fff5700b7b47ea319901b0929a@ruby-forum.com> |
| In reply to | #3378 |
I already found the solution. thx -- Posted via http://www.ruby-forum.com/.
[toc] | [prev] | [standalone]
Back to top | Article view | comp.lang.ruby
csiph-web