Tech Off Thread

5 posts

Forum Read Only

This forum has been made read only by the site admins. No new threads or comments can be added.

How to do search option?

Back to Forum: Tech Off
  • User profile image
    srinivasapr​abhu

    hI! friends

                  I hope u guys doing well.Anyone tell me how to implement search option in XML file.I give any keyword means it should be highlight the location of the keyword in the xml file only exist.

    Plz tell me anyone!!

    Scared

    Regards,

    Srinivas

  • User profile image
    W3bbo

     

    String query;

    String currentLine;

    int lineNumber;

    while( (currentLine = reader.ReadLine()) != null ) {

        lineNumber++;

        if( currentLine.Contains(query) ) Console.WriteLine("{0}: {1}", lineNumber, currentLine);

    }

  • User profile image
    ManipUni

    What is supported, can it for example find Attributes, Values, and Names? Does it understand XML or will it return for e.g. "<Node>"

     

    I mean there is a huge difference between an "XML Search" and a "Search."

  • User profile image
    srinivasapr​abhu

    W3bbo said:

     

    String query;

    String currentLine;

    int lineNumber;

    while( (currentLine = reader.ReadLine()) != null ) {

        lineNumber++;

        if( currentLine.Contains(query) ) Console.WriteLine("{0}: {1}", lineNumber, currentLine);

    }

    Good code Mr.John thnks a lot... Big Smile

  • User profile image
    justinlandon

    ManipUni said:

    What is supported, can it for example find Attributes, Values, and Names? Does it understand XML or will it return for e.g. "<Node>"

     

    I mean there is a huge difference between an "XML Search" and a "Search."

    yaa i was also looking for the same thing, thanks.

Conversation locked

This conversation has been locked by the site admins. No new comments can be made.