39
1
using System;
2
namespace FreshersCoderTesting
3
{
4
public class FreshersCoderDemo
5
{
6
public static void Main(string[] args)
7
{
8
Console.WriteLine("Welcome To FreshersCoder Tutorials: https://www.fresherscoder.com");
9
Console.WriteLine("\n\n");
10
Console.Write("Enter String: ");
11
string _string = Console.ReadLine();
12
if (!string.IsNullOrWhiteSpace(_string))
13
{
14
char[] _stringArray = _string.ToCharArray();
15
16
for (int i = 0; i < _stringArray.Length; i++)
17
{
18
if(_stringArray[i]!='@')
19
{
20
int _count = 0;
21
Console.Write(_stringArray[i]);
22
for (int j = i; j < _stringArray.Length; j++)
23
{
24
if (i == j)
25
_count = 1;
26
27
if (i != j && _stringArray[i] == _stringArray[j])
28
{
29
_stringArray[j] = '@';
30
_count = _count + 1;
31
}
32
}
33
Console.Write(_count);
34
}
35
}
36
}
37
}
38
}
39
}
Cached Result
Environment version: .NET 9.0.0 (9.0.0, Unix 6.8.0.1014)
<someOuterElementNotShown>
<title>Discourse interaction between <italic>The New York Times</italic> and <italic>China Daily</italic></title>
<subtitle>The case of Google's departure</subtitle>
</someOuterElementNotShown>
Discourse interaction between The New York Times and China Daily: The case of Google's departure
<someOuterElementNotShown>
<title>Discourse interaction between <italic>The New York Times</italic> and <italic>China Daily</italic></title>
<subtitle>The case of Google's departure</subtitle>
</someOuterElementNotShown>
Discourse interaction between The New York Times and China Daily: The case of Google's departure