Split dot and equa sign by recursive

S

Siratinee Sukachai

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?
 
H

Harry Kakueki

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
 
B

Brian Candler

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.
 
R

Ryan Davis

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.
 
S

Sira PS

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?


Yes, that's what I want.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,680
Members
48,796
Latest member
Greg L.

Latest Threads

Top