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
Disposal Scenario: #1
Disposal Scenario: #2
[d2].Base.Dispose()
[d2].Derived.Dispose(true)
[d2] Unmanaged memory freed at 000001d171c7bd70
[d2].Base.Dispose(true)
[d2] Removed from tracking list: 00000000022378a0
Disposal Scenario: #3
[d3].Base.Dispose()
[d3].Derived.Dispose(true)
[d3] Unmanaged memory freed at 000001d171c7c050
[d3].Base.Dispose(true)
[d3] Removed from tracking list: 000000000273be28
Disposal Scenario: #4
Objects remaining to dispose = 2
Reference Object: d1, 0000000001944fac
Reference Object: d4, 000000000056fc0a
Dequeueing finalizers...