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 1094463
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T23:58:33+00:00 2026-05-16T23:58:33+00:00

I have the following dynamically generated array: var myArray = (0% { left:74px; top:202px;

  • 0

I have the following dynamically generated array:

var myArray = ("0% { left:74px; top:202px; }"   , "44% { left:427px; top:122px; }", "0% { font-size:11px; }", "55% { font-size:49px; }" );

There are 2 entries that have the same start value: 0%. How can I find this and combine it together:

form:
0% { left:74px; top:202px; },
0% { font-size:11px; },
to
0% { left:74px; top:202px; font-size:11px;},

Thank you

Edited the code to a valid array.

  • 1 1 Answer
  • 2 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-16T23:58:34+00:00Added an answer on May 16, 2026 at 11:58 pm

    oh, I see.. you’re printing your array and this is what you’re getting, right?

    In that case…

    for(var i =0; i< myArray.length ; i++){
      for(var j=i+1; j<myArray.length;j++){
          if(i == j) continue;
          if(myArray[i].substring(0,3) == myArray[j].substring(0,3)){//found matching first 2 chars
             myArray[i] = myArray[i].substring(0,3) + myArray[j].replace(/\{(.*?)\}/,"$1 ;") + myArray[i].substring(4);
    
            myArray.splice(j--,1);//remove the doup and decrease the counter so you don't skip one now that the array is shorter
    
          }
      }
    }
    

    I didn’t test this, but something to this effect 🙂

    Oh.. you edited. What you have now is definitely not an array… but you’re closer than you were before.

    I think array is a reserved word…

    var myArray = ("0% { left:74px; top:202px; }"   , "44% { left:427px; top:122px; }", "etc", "etc" );
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following dynamically generated strings: var stringA = [a1, a2, a3 ...
I have the following dynamically generated table on a page along with other tables
I have the following variable being dynamically set by user generated content: $variable =
I have a array of string myArray[] in my jQuery the value is generated
Possible Duplicate: Dynamically creating/inserting into an associative array in PHP I have the following
I have an array of button which is dynamically generated at run time. I
I have following markup which is generated dynamically using C# in my asp.net MVC2
I have the following form (it is dynamically generated and I have a few
I have dynamically generated code like the following: <div class=message-error error>The Message field is
I have the following code generated dynamically. It can be just one, two, three

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.