ParserSearch Method (String) |
Namespace: GroupDocs.Parser
The following example shows how to find a keyword in a document:
// Create an instance of Parser class using(Parser parser = new Parser(filePath)) { // Search a keyword: IEnumerable<SearchResult> sr = parser.Search("page number"); // Check if search is supported if(sr == null) { Console.WriteLine("Search isn't supported"); return; } // Iterate over search results foreach(SearchResult s in sr) { // Print an index and found text: Console.WriteLine(string.Format("At {0}: {1}", s.Position, s.Text)); } }