Welcome to Dream.In.Code
Become a VB.NET Expert!

Join 149,407 VB.NET Programmers for FREE! Get instant access to thousands of VB.NET experts, tutorials, code snippets, and more! There are 2,191 people online right now. Registration is fast and FREE... Join Now!




Reading each letter in the textbox?

 
Reply to this topicStart new topic

Reading each letter in the textbox?, we are making a proj for Automata

michang05
22 Jan, 2008 - 04:59 AM
Post #1

New D.I.C Head
*

Joined: 9 Nov, 2007
Posts: 7


My Contributions
we are on a project about converting a Regular Expression to Finite automata and telling if the inputted letters are valid or not

our problem is how can we read the inputted letters character by character, sorry but i know this is a little old , i really had a bad habit in string manipulation..

example:
Input> AABB

"how do i use the A-A-B-B" so that i can code the appropriate algo for each code."

thanks..

we are applying this on ASP.NET
User is offlineProfile CardPM
+Quote Post

Jayman
RE: Reading Each Letter In The Textbox?
22 Jan, 2008 - 11:29 AM
Post #2

Student of Life
Group Icon

Joined: 26 Dec, 2005
Posts: 7,297



Thanked: 66 times
Dream Kudos: 500
Expert In: Everything

My Contributions
You can take all the letters in the TextBox and store them into a character array using the ToCharArray method. Then loop through the array checking each letter.
CODE

Dim myArray() As Char
myArray = Me.TextBox1.Text.ToCharArray

User is offlineProfile CardPM
+Quote Post

RodgerB
RE: Reading Each Letter In The Textbox?
23 Jan, 2008 - 04:41 AM
Post #3

D.I.C Lover
Group Icon

Joined: 21 Sep, 2007
Posts: 2,164



Thanked: 17 times
Dream Kudos: 2200
Expert In: Dot Net Technologies

My Contributions
Alternatively if you want to just loop through all char types in the string, but using a temporary variable:

CODE

For Each chr As Char In Me.TextBox1.Text
    ' Your new charactor will be stored in the chr variable.
Next

User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 1/7/09 10:36AM

Be Social

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

Live VB.NET Help!

VB.NET Tutorials

Reference Sheets

VB.NET Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month