درود بر تمامی برنامه نویسان ایران زمین امروز ، کدی رو براتون آماده کرده ام که همون کار متد Contains رو انجام میده.امیدوارم که این آموزش به دردتون بخوره و مورد استفاده قرارش بدین.(از این کد برای کارهایی مثل search کردن استفاده میشه)
این هم کد:
namespace StringMatching
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Enter the string");
string s1 = Convert.ToString(Console.ReadLine()).Trim().ToUpper();
Console.WriteLine("Enter the string to be search");
string s2 = Convert.ToString(Console.ReadLine()).Trim().ToUpper();
int sourceIndex = 0;
int searcIndex = 0;
bool searchResult = false;
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Enter the string");
string s1 = Convert.ToString(Console.ReadLine()).Trim().ToUpper();
Console.WriteLine("Enter the string to be search");
string s2 = Convert.ToString(Console.ReadLine()).Trim().ToUpper();
int sourceIndex = 0;
int searcIndex = 0;
bool searchResult = false;