Home > DeveloperSection > Forums > c# windows forms tab control
john rob

Total Post:108

Points:756
Posted on    September-24-2013 4:42 AM

 C#
Ratings:


 1 Reply(s)
 844  View(s)
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.



Pravesh Singh

Total Post:411

Points:2881
Posted on    September-24-2013 7:45 AM

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);


Don't want to miss updates? Please click the below button!

Follow MindStick