School Assignment? Project Due Tomorrow? Chat LIVE With A Programming Expert!
Welcome to Dream.In.Code
Become an Expert!

Join 340,162 Programmers for FREE! Get instant access to thousands of experts, tutorials, code snippets, and more! There are 4,037 people online right now. Registration is fast and FREE... Join Now!



Searching a string for vowels

Searching a string for vowels A program that will accept string input from the user. the program wil Rate Topic: -----

#1 wanklik  Icon User is offline

  • New D.I.C Head
  • Pip
  • Group: New Members
  • Posts: 5
  • Joined: 05-June 09


Dream Kudos: 0

Post icon  Posted 05 June 2009 - 11:26 PM

A program that will accept string input from the user. the program will determin the number of vowel character(s) in a string and convert it * symbol.
Was This Post Helpful? 0
  • +
  • -


#2 firebolt  Icon User is offline

  • D.I.C Lover
  • Icon
  • View blog
  • Group: Author w/DIC++
  • Posts: 5,555
  • Joined: 20-February 09


Dream Kudos: 1675

Posted 05 June 2009 - 11:34 PM

Post your question in the body and not the description field please.
Also, could we see the code that you are working on and could you post it like so :code:
Was This Post Helpful? 0
  • +
  • -

#3 vb5prgrmr  Icon User is offline

  • D.I.C Addict
  • PipPipPipPip
  • Group: Members
  • Posts: 645
  • Joined: 21-March 09


Dream Kudos: 0

Posted 06 June 2009 - 06:11 PM

In VB's help, look up the following...

Instr
Mid
Replace

Good Luck
Was This Post Helpful? 1
  • +
  • -

#4 wanklik  Icon User is offline

  • New D.I.C Head
  • Pip
  • Group: New Members
  • Posts: 5
  • Joined: 05-June 09


Dream Kudos: 0

Posted 08 June 2009 - 01:38 AM

thanks....
Was This Post Helpful? 0
  • +
  • -

#5 HyFlaZher  Icon User is offline

  • New D.I.C Head
  • Pip
  • Group: New Members
  • Posts: 6
  • Joined: 13-March 09


Dream Kudos: 0

Posted 15 June 2009 - 08:40 PM

View Postwanklik, on 5 Jun, 2009 - 11:26 PM, said:

A program that will accept string input from the user. the program will determin the number of vowel character(s) in a string and convert it * symbol.


Here is a my simple code:


Private Sub Command1_Click()
Dim vowels As Integer, x As Integer
Dim c As String, ss As String 'ss the output string

x = 0
Do While x < Len(Text1.Text)
	
	c = Mid(Text1.Text, x + 1, 1) 'Get a character
	
	If LCase(c) = "a" Or LCase(c) = "e" Or _
	   LCase(c) = "i" Or LCase(c) = "o" Or _
	   LCase(c) = "u" Then
		
		vowels = vowels + 1
		
	End If
	
	x = x + 1
Loop

ss = Replace(Text1.Text, "A", "*")
ss = Replace(ss, "A", "*")
ss = Replace(ss, "a", "*")
ss = Replace(ss, "E", "*")
ss = Replace(ss, "e", "*")
ss = Replace(ss, "I", "*")
ss = Replace(ss, "i", "*")
ss = Replace(ss, "O", "*")
ss = Replace(ss, "o", "*")
ss = Replace(ss, "U", "*")
ss = Replace(ss, "u", "*")

End Sub



Was This Post Helpful? 0
  • +
  • -

#6 NoBrain  Icon User is online

  • D.I.C Lover
  • Icon
  • View blog
  • Group: Authors
  • Posts: 1,487
  • Joined: 25-March 09


Dream Kudos: 350

Posted 16 June 2009 - 12:11 AM

hmm i gues that is good but textbox has a property name PasswordChar may be that can help :P and i gues it is faster to put just * in there :P

This post has been edited by NoBrain: 16 June 2009 - 12:12 AM

Was This Post Helpful? 0
  • +
  • -

#7 born2c0de  Icon User is offline

  • printf("I'm a %XR",195936478);
  • Icon
  • View blog
  • Group: Moderators
  • Posts: 4,566
  • Joined: 26-November 04


Dream Kudos: 2825

Expert In: J2ME, 80x86 Assembly, C/C++, VB6, VB.NET, C#, J2SE, Win32 API, Reversing

Posted 16 June 2009 - 03:15 AM

Edited Topic Title to be more descriptive.
Was This Post Helpful? 0
  • +
  • -



Fast Reply

  

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users



Live Help!

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter Fan Us On Facebook

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month