Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6369811
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T00:51:05+00:00 2026-05-25T00:51:05+00:00

I was doing a challenge of building a tree from all html elements. And

  • 0

I was doing a challenge of building a tree from all html elements. And I am 90% done, but I got stuck…

How do I change this string into a tree?:

mystring= “red1/(none)-red2/red1-blue1/red2-blue2/red2-blue3/red2-red3/red1-red4/red3-red5/red4-red6/red5-blue4/red6”;

After splitting them by “-” we will have:

10 groups of -> (parameter1)/(parameter2)

The first parameter it is the object,
The second parameter is the ‘in-what-it-will-be-contained’

I have no idea how to move every ‘parameter1’ inside ‘parameter2’. (note: sometimes the parameter1 will be the parameter2 of a parameter1)

Visual example of what I mean with a parameter is inside another parameter: (this example uses exactly the string above)

http://img853.imageshack.us/img853/6893/grg.jpg

Probably we should use arrays?, idk… I am totally lost :sadface:

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T00:51:06+00:00Added an answer on May 25, 2026 at 12:51 am

    Actually, I found a simpler/shorter/neater way using the JQuery function AppendTo()

    We just need to:

    1. Split the parameters…

    2. Create one div for each (parameter1)

    3. Use a loop to move every (parameter1) inside (parameter2) using the
      AWESOME AppendTo() function that JQuery offers

    The best thing is that they are actually inside them, so you can easily put a Hide/Show effect to make a cool effect

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

8,5,,1,4,7,,,,7,,1,9,3,6,,,8,6,3,9,,2,5,4,,,,,3,2,,,7,4,1,1,,4,,6,9,,5,,,,5,,,1,,6,3,,,6,5,,,,7,4,,1,7,6,,,,8,,5,,,7,1,,3,9, I'm doing a programming challenge where i need to parse this sequence into
I've never seen this done, but i get a feeling that there's gotta be
I have this new challenge to load ~100M rows from an Oracle database and
I have a similar challenge to this post: Batch insert/update with entity framework from
When doing case-insensitive comparisons, is it more efficient to convert the string to upper
I'm wondering if this is the most elegant and efficient way of doing this?
I'm doing a simple challenge for a programming book that's asks to output the
My challenge here is to search a webpage to attempt to find all of
How would I ignore everything after a certain section in a string? The challenge
I am doing Python challenge in Ruby. I need to read the file contents

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.