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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T17:46:04+00:00 2026-06-16T17:46:04+00:00

What I am trying to achieve is to split a string into multiple adresses

  • 0

What I am trying to achieve is to split a string into multiple adresses like “NL,VENLO,5928PN” which getLocation will return a “POINT( x y)” string value.

This works. Next I need to create a WayPointDesc object for each location. And each of these objects has to be pushed into the WayPointDesc[]. I have tried various methods but I cannot find a feasable option so far. My last resort is to hardcode a maximum amount of waypoints but I would rather avoid such a thing.

Using a list is unfortunately not an option… I think.

This is the function:

    /* tour()
     * Input: string route
     * Output: string[] [0] DISTANCE [1] TIME [2] MAP
     * Edited 21/12/12 - Davide Nguyen
     */
    public string[] tour(string route)
    {
        // EXAMPLE INPUT FROM QUERY
        route = "NL,HELMOND,5709EM+NL,BREDA,8249EN+NL,VENLO,5928PN"; 
        string[] waypoints = route.Split('+');

        // Do something completly incomprehensible
        foreach (string point in waypoints)
        {
            xRoute.WaypointDesc wpdStart = new xRoute.WaypointDesc();
            wpdStart.wrappedCoords = new xRoute.Point[] { new xRoute.Point() };
            wpdStart.wrappedCoords[0].wkt = getLocation(point);
        }

        // Put the strange result in here somehow
        xRoute.WaypointDesc[] waypointDesc = new xRoute.WaypointDesc[] { wpdStart };

        // Calculate the route information
        xRoute.Route route = calculateRoute(waypointDesc);
        // Generate the map, travel distance and travel time using the route information
        string[] result = createMap(route);
        // Return the result
        return result;

        //WEEKEND?
    }
  • 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-16T17:46:05+00:00Added an answer on June 16, 2026 at 5:46 pm

    Arrays are fixed-length, if you want to dynamically add elements, you need to use some type of linked list structure. Also, your wpdStart variable was out of scope when you were adding it originally.

        List<xRoute.WaypointDesc> waypointDesc = new List<xRoute.WaypointDesc>();
    
        // Do something completly incomprehensible
        foreach (string point in waypoints)
        {
            xRoute.WaypointDesc wpdStart = new xRoute.WaypointDesc();
            wpdStart.wrappedCoords = new xRoute.Point[] { new xRoute.Point() };
            wpdStart.wrappedCoords[0].wkt = getLocation(point);
    
            // Put the strange result in here somehow
            waypointDesc.add(wpdStart);
        }
    

    If you really want the list as an array later, use: waypointDesc.ToArray()

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

Sidebar

Related Questions

I am trying to split a string using a regex A.*B, which works just
I'm trying to split a string into tokens (via regular expressions) in the following
I am trying to split a string into terms in PHP using preg_split. I
I am trying to split a string based on the - character and insert
I am trying to split a comma-separated string and then perform some action on
I'm trying to split a string using a regular expression. Friday 1Friday 11 JAN
I'm trying to split multiple joined words and I've a perl script I've grabbed
I'm currently trying to split a string in C# (latest .NET and Visual Studio
Trying to achieve a background on a page that is "split in two"; two
I have the following string that I'm trying to parse into a dict of

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.