Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
character occurrence in the given string
//Rextester.Program.Main is the entry point for your code. Don't change it. //Microsoft (R) Visual C# Compiler version 2.9.0.63208 (958f2354) using System; using System.Collections.Generic; using System.Linq; using System.Text.RegularExpressions; namespace Rextester { public class Program { public static void Main(string[] args) { String str = "write a program to"; Console.WriteLine("String: " + str); while (str.Length > 0) { Console.Write(str[0] + " = "); int cal = 0; for (int j = 0; j < str.Length; j++) { if (str[0] == str[j]) { cal++; } } Console.WriteLine(cal); str = str.Replace(str[0].ToString(), string.Empty); } Console.ReadLine(); } } }
run
|
edit
|
history
|
help
0
General.cs
D12
Lab7
sdfghuyhtgrfedwsx
Vajdalinky
3. Delegates and events
jjj4
asdfgthyjukjyhtgrfed
MegaWays
MIXED CONTENT - string and numbers separation in a large string