Cerebrus
unread,Dec 25, 2008, 4:21:29 AM12/25/08Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to DotNetDevelopment, VB.NET, C# .NET, ADO.NET, ASP.NET, XML, XML Web Services,.NET Remoting
This is the solution I sent on the 20th, in response to Sushma's email
to me :
---
private void FindVowels(string input)
{
char[] vowels = new Char[] { 'a', 'e', 'i', 'o', 'u' };
int pos = 0;
bool found = false;
do
{
pos = input.IndexOfAny(vowels, pos);
if(pos > -1)
{
pos += 1;
Console.WriteLine("Vowel found at position: {0}", pos.ToString
());
if(!found)
found = true;
}
} while(pos > -1);
if(found == false)
Console.WriteLine("No Vowels found in the supplied string.");
}
---
Comments/improvements are appreciated.
On Dec 25, 10:54 am, "sushma sushma" <
sushma...@gmail.com> wrote:
> Here you go.
>
> using System;
> using System.Collections.Generic;
> using System.Text;
>
> namespace ConsoleApplication3
> {
> class Program
> {
> static void Main(string[] args)
> {
> Console.WriteLine("Enter the string");
> string chr = Console.ReadLine().ToLower();
> char ch2 = 'a';
> char ch3 = 'e';
> char ch4 = 'i';
> char ch5 = 'o';
> char ch6 = 'u';
> int j = 0;
>
> foreach (char ch in chr)
> {
>
> if ((ch == ch2)|(ch == ch3)|(ch == ch4)|(ch == ch5)|(ch ==
> ch6))
> j++;
> }
> Console.WriteLine(j);
> }
> }
>
> }
>
> On Wed, Dec 24, 2008 at 7:25 PM, Brandon Betances <
bbetan...@gmail.com>wrote:
>
>
>
>
>
>
>
> > DAMN. Endless for-else loops and an undeclared variable. sweet.
>
> > On Wed, Dec 24, 2008 at 6:30 PM, DotnetBeginner <
sushma...@gmail.com>
> Email:
sushma...@gmail.com
>
> Mobile:
(571) 438 1206- Hide quoted text -
>
> - Show quoted text -