如何在Microsoft Visual Basic 2008速成版中创建元音计数应用程序? [英] How do you create a Vowel Count application in Microsoft Visual Basic 2008 Express Edition?

查看:64
本文介绍了如何在Microsoft Visual Basic 2008速成版中创建元音计数应用程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要创建一个应用程序来计算一个文本框中有多少个元音,然后在一个标签中显示它们的数量,这些标签与短语" 元音的数量"连接在一起*输入的单词  ;或短语* 是:
"我按下按钮后。它需要计算所有元音(包括字母"y"),无论它们是大写还是小写,它必须使用循环函数,显然因为它必须计算并显示I
之后的元音数量按一个按钮就必须在一个私人子中完成。

Hi, I need to create an application that counts how many vowels there are in a text box and then displays the amount of them in a label concatenated with the phrase "The number of vowels in *Entered word or phrase* is: " after I push a button. It needs to count all vowels (including the letter "y") regardless of whether they are uppercase or lowercase, it must use a loop function, and obviously since it has to count and display the number of vowels after I press a button it all has to be done in one private sub.

推荐答案

如果这是作业,你只需要一个循环。

You only need a loop if this is homework.

Dim Input As String = "How can I count vowels in string by using loop and if,, I wrote this code which is not working don't know where I went wrong? I don't want to use array either"
Console.WriteLine(New Regex("(?i)[aeiou]").Matches(Input).Count)


这篇关于如何在Microsoft Visual Basic 2008速成版中创建元音计数应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆