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

  • SEARCH
  • Home
  • 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 8095189
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T21:02:25+00:00 2026-06-05T21:02:25+00:00

I try to split a string to send it to arraycollection. The problem is

  • 0

I try to split a string to send it to arraycollection.
The problem is that each record contain several field.
With one field, I found how to do but in my case, no.

var str:String="12/12/2008-70,15#05/03/2005-193,50#23/04/1987-45,23";

 public function splitDouble(stringInit:String,sep1:String):ArrayCollection{


            var tempAc:ArrayCollection= new ArrayCollection((stringInit.split(sep1)));
            return tempAc;
        }

    }

Record delimiter is ‘#’, field delimiter is ‘,’.
I’d like to add something like that:
tempAc[0][0]==12/12/2008;
tempAc[0][1]==70,15;

Thanks

So, can you help me to solve that?

Thanks

  • 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-06-05T21:02:28+00:00Added an answer on June 5, 2026 at 9:02 pm

    Nearly there, try something like this:

    public function splitDouble(source:String,rSeparator:String,fSeparator:String):ArrayCollection{
                var records:Array = source.split(rSeparator);
                var result:Array = [];
                for (var i : int = 0; i < records.length; i++) {
                    result[i] = records[i].split(fSeparator);
                }
                return new ArrayCollection(result);
            }
    

    For brevity you could use the every() function, but I think it’s simpler/cleaner without an anonymous function or something like that.

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

Sidebar

Related Questions

When I try to split a string into a string list where each element
I'm beginner with PHP and I try to use preg_math_all to split a string.
I'm using lapply to try to split up a character string in a data
When I try to split a string in node I get the following error...
in my function in a jquery, i try to split a long string. i
I'd like to split a string using one or more separator characters. E.g. a
I try to understand the regex in python. How can i split the following
Try this code - import java.io.StringReader; public class StringReaderTest { public static void main(String[]
Try this piece of code - public class WhitespaceTest { public static void main(String[]
split this String using function split. Here is my code: String data= data^data; String[]

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.