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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T13:37:51+00:00 2026-06-04T13:37:51+00:00

I have a model with a property string that can be the format 00000044

  • 0

I have a model with a property string that can be the format “00000044” so assuming I’m querying a List of

public class Foo
{
     private string MemberNo { get; set; }
}

populated from Entity Framework,

and our set includes the following:

"00000044" include this
"44000000" include this
"20440000" exclude this

how to write a query that will exclude anything with non-zero number to the left of our search criteria “44”

Is it possible to combine Regex with linq or is there a smarter way?

Ta

  • 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-04T13:37:52+00:00Added an answer on June 4, 2026 at 1:37 pm
    var filteredFoos = myFoos
        .Where(foo => foo.MemberNo.TrimStart('0').StartsWith("44"));
    

    Now this is if you want to bring back all Foos, but if you’d like to use the Entity Framework, look at this answer to translate it correctly.

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

Sidebar

Related Questions

How can I override the IsValid property? I have a model that's validating as
I have a model that has several properties. The properties can be primitive (String)
Suppose I have this model: public class ViewModel { [Required] public string UserInput {
in my Model I have a string property Feeds with value like that: <img
I have a entity that has a scalar string property Clarified. Clarified can have
I have an MVC application. The model has a property that is a struct
I have a model in App Engine that I am exporting in CSV format
So let's say I have a small model object that contains a string that's
Is there any way that can I set default value as Empty.string in Model.
I have two Dictionary<string, byte> properties in my model that should validate properly with

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.