ByteScout Spreadsheet SDK - C# - Search Text - ByteScout

ByteScout Spreadsheet SDK – C# – Search Text

  • Home
  • /
  • Articles
  • /
  • ByteScout Spreadsheet SDK – C# – Search Text

How to search text in C# and ByteScout Spreadsheet SDK

This tutorial will show how to search text in C#

We made thousands of pre-made source code pieces for easy implementation in your own programming projects. ByteScout Spreadsheet SDK is the SDK to create, read, modify and calculate spreadsheets. Formula calculations are supported, import and export to and from JSON, CSV, XML, databases, arrays and you can use it to search text with C#.

You will save a lot of time on writing and testing code as you may just take the C# code from ByteScout Spreadsheet SDK for search text below and use it in your application. In your C# project or application you may simply copy & paste the code and then run your app! Implementing C# application typically includes multiple stages of the software development so even if the functionality works please test it with your data and the production environment.

You can download free trial version of ByteScout Spreadsheet SDK from our website to see and try many others source code samples for C#.

Try ByteScout Spreadsheet SDK today:  60 Day Free Trial (on-premise) or  Web API (on-demand version)

using System; using Bytescout.Spreadsheet; using Bytescout.Spreadsheet.BaseClasses; namespace SearchText { class Program { static void Main(string[] args) { // Open spreadsheet from file Spreadsheet document = new Spreadsheet(); document.LoadFromFile("example.xls"); // Get first worksheet Worksheet worksheet = document.Workbook.Worksheets[0]; // Find cells containing "in" substring Cell cell = worksheet.Find( "in", false /*case insesitive*/, false /*not regexp*/, false /*search forward*/); while (cell != null) { // Print found cell address and value to console CellAddress address = cell.GetAddress(); string message = string.Format( "({0}, {1}): {2}", address.Column, address.Row, cell.ValueAsExcelDisplays); Console.WriteLine(message); cell = worksheet.FindNext(); } document.Dispose(); Console.WriteLine(); Console.WriteLine("Press any key to continue."); Console.ReadKey(true); } } }

Try ByteScout Spreadsheet SDK today:  60 Day Free Trial (on-premise) or  Web API (on-demand version)



Get 60 Day Free Trial or Visit ByteScout Spreadsheet SDK Home Page

Explore ByteScout Spreadsheet SDK Documentation

Get ByteScout Spreadsheet SDK Free Training


Get Your Free API Key

Explore Web API Documentation