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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T12:07:37+00:00 2026-05-23T12:07:37+00:00

I need to split up some strings, but the number of characters and position

  • 0

I need to split up some strings, but the number of characters and position will change, This is quite easy in PHP but seems more complicated in C#.

These are greyhound results in the UK.

I have these strings in an array, I need to extract almost everything from each string, So I need a quick and simple solution to this. I need to be able to extract the Date, Time, Course(Crayfd), Distance(540m), also the Winner only(no “Winner(s): “, need to remove this), and also the marketID from the URL.

So what built in c# functions would be best suited for all this?, a small example of some c# functions and how I use them would be great.
Also a small explanation would also be great.

[0, 0] = "BAGS cards / Crayfd 2nd Jul - 12:58 S6 540m settled"
[0, 1] = "Winner(s):  Springtown Mary"
[0, 2] = "http://rss.betfair.com/Index.aspx?format=html&sportID=4339&marketID=103165302"

[1, 0] = "BAGS cards / Crayfd 2nd Jul - 12:58 TO BE PLACED settled"
[1, 1] = "Winner(s):  Black Hawk Boy,  Springtown Mary"
[1, 2] = "http://rss.betfair.com/Index.aspx?format=html&sportID=4339&marketID=103165303"

[2, 0] = "Forecast Betting / Crayfd (FC) 2nd July - 12:58 Forecast settled"
[2, 1] = "Winner(s): 1 - 3"
[2, 2] = "http://rss.betfair.com/Index.aspx?format=html&sportID=4339&marketID=103164570"

[3, 0] = "BAGS cards / Romfd 2nd Jul - 12:49 A2 400m settled"
[3, 1] = "Winner(s):  Come On Rosie"
[3, 2] = "http://rss.betfair.com/Index.aspx?format=html&sportID=4339&marketID=103165272"
  • 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-23T12:07:38+00:00Added an answer on May 23, 2026 at 12:07 pm

    I’d suggest using String.Split, String.[Last]IndexOf, String.Substring, and LINQ extensions (simple ones, e.g. .Last(), just to simplify things).
    e.g. if the URL is in string url and it’s safe to assume the marketId is always at the end like that:

    int marketId = int.Parse(url.Split('=').Last());
    

    Or to get things from the first line, if it’s called courseEtc:

    string[] courseEtcParts = courseEtc.Split('/', '-');
    string[] lastParts = courseEtcParts.Split();
    string time = lastParts[0];
    

    And to look for something like a distance, you could use regex. Something like [0-9]+m.

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

Sidebar

Related Questions

So from this string: name[id] I need this: id I used str.split ('[]'), but
Not sure if this is the best approach but I have some string which
I need to split this line string in each line, I need to get
This seems like a noob question, but the simple answer is eluding me. I
i have a input tag which is non editable, but some times i need
I need to do some global changes to a number of spreadsheets and I
I have a chunk of data from which I need to extract some strings
I'm writing a C# class that will convert strings to dates. Pretty easy I
My client has a multi-page PDF file. They need it split by page. Does
I am just embarking on my first large-scale refactor, and need to split an

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.