C# WINDOWS FORMS TAB CONTROL

john rob

Total Post:108

Points:756
Posted by  john rob
C#
 1090  View(s)
Ratings:
Rate this:

Can any one help me with a code for displaying vowels from a text entered in a textbox and text should be displayed in a lable ..

I used tab control for placing textbox and lable i place textbox in one tab and lable in another..

Ex if the text entered in text box is David

then if i click lable in another tab a msg should be displayed inside the lable Vowels are : a,i

plz help me with the code.

  1. Pravesh Singh

    Post:412

    Points:2888
    Re: c# windows forms tab control

    Hi John,

    you can try this,

    public static string ExtractVowels(string text)

    {

        // Note that this won't find upper-case vowels...

        var vowelArray = text.Where(c => "aeiou".Contains(c))

                             .ToArray();

        // Upper-case it if you want, of course.

        return new string(vowelArray);

    }

    call this method on Button click

     label1.Text=ExtractVowels(textbox1.text);

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!