3
Answers

Search in a list for more than one search term

Ask a question
Markus

Markus

12y
1.1k
1
Hi,

i am a beginner in programming, i try to search in a list as following. I will try to discribe a bit

... My Class
  class TBook
  {
  public string booktype { get; set; }
  public string titel { get; set; }
  public string author { get; set; }
  public string isbn { get; set; }
  public int pages { get; set; }


  public TBook(string booktype = "" , string titel = "", string author = "", string isbn = "", int pages = 0)
  {
    this.booktype = booktype;
  this.author = author;
  this.isbn = isbn;
  this.pages = pages;
  this.titel = titel;
  }
   
  }
...

.... My List
namespace Bookstore
{
  public partial class Bookstore : Form
  {
  private const string serializeName = "bookstore.dat";

  TBookstore booksstore;
  List<TBook> books = new List<TBook>();
....

... now my Problem.

as Example, i like to search for all Books of booktype "Standard" containing Math (or something with wildcard like *mat*) in titel. Afterwards i like to return it to an listview.

I tried a lot but nothing works.

Hope you can help me and that i gave enough input.

Regards
Markus


Answers (3)