-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSearch String Palava
40 lines (33 loc) · 1.05 KB
/
Search String Palava
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using System.Threading.Tasks;
namespace SearchStringStuff
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Enter the substring OR string you want to search for");
string x = Console.ReadLine();
Console.WriteLine("enter the string or substring to be searched::");
string SearchedText = Console.ReadLine();
string[] myarray = new string[100000];
myarray = x.Split(' ');
//starts the initialization process
int k = 0;
foreach (string v in myarray)
{
k = k + 1;
if (v == SearchedText)
{
Console.WriteLine("The string found at position:" + i);
}
}
Console.WriteLine("-------------------------------------------");
Console.ReadLine();
}
}
}