Run Code
|
API
|
Code Wall
|
Users
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Count vowels in a string
//Rextester.Program.Main is the entry point for your code. Don't change it. //Compiler version 4.0.30319.17929 for Microsoft (R) .NET Framework 4.5 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 = "hello am here now ooo"; countVowels(str); } public static void countVowels(String st) { int vowelct=0; foreach(char ch in st.ToLower()) { if((ch>='A' && ch<='Z')||(ch>='a' && ch<='z')) if(ch=='a'||ch=='e'||ch=='i'||ch=='o'||ch=='u') vowelct++; if(ch=='A'||ch=='E'||ch=='I'||ch=='O'||ch=='U') vowelct++; } Console.Write("Vowels count " + vowelct); } } }
run
|
edit
|
history
|
help
0
Please
log in
to post a comment.
Compress in C#
Prueba
unix practice - santhosh
Bid Status
Before Number big
encryption
sdcsadxsdf
ColoredTriangleVaoOpenTK4OpenGL31 (Added shaders to Program.cs)
Dio
FizzBuzz C#
Please log in to post a comment.