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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T09:24:44+00:00 2026-05-12T09:24:44+00:00

I have a database column, delimited by colons, describing a category hierarchy like so:

  • 0

I have a database column, delimited by colons, describing a category hierarchy like so:

ID | Category

100 | Domestic:Trees:Fruit:Apples

I would like to extract only the third segment of the hierarchy “Fruit” from the text. How can I use Linq Regex or Linq Filtering to extract just that segment? Is it a good idea to extract information this way for every time a user selects a category?

  • 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-12T09:24:44+00:00Added an answer on May 12, 2026 at 9:24 am

    Your question makes it sound like you want a linq answer only – so if you wanted to use linq, you could do this…

    string s = "Domestic:Trees:Fruit:Apples".Split(':')
               .Select((item, index) => new {item, index})
               .Where(i => i.index == 2)
               .Select(i => i.item);
    

    Doing it in linq vs just splitting the string and taking the one you need isn’t going to make your code any easier to read – so you may want to just consider going with just a straight split as Andrew suggested.

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

Sidebar

Related Questions

I have a database column which contains varchar data type. I would like to
Let's say I have a database column 'grade' like this: |grade| | 1| |
I have a Database column with the syntax 0000-00-00 00:00:00. In PHP I would
I have a very large column-delimited file coming out of a database report in
I have a database column WantsReply that logically holds a boolean (bit) but is
I have a database column that contains the contents of a file. I'm converting
(Note: This is for MySQL's SQL, not SQL Server.) I have a database column
I have at my SQL Server 2000 Database a column with type Image .
I have some files stored in a database blob column in Oracle 9. I
I have several database tables that just contain a single column and very few

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.