Getting Textbox data into an Array: VB 2008

V

vbStudent

Dear All,

I have textbox in my form .. I enter the student name in the text e.x
(vbstudent)

I want to sign textbox data to array, each letter in one index.

ex
array(0)=v
array(1)=b
array(2)=s
array(3)=t
array(4)=u
array(5)=d
array(6)=e
array(7)=n
array(8)=t

How can I do that .. please reply me soon.

Thanks for your cooperation
 
K

kimiraikkonen

Dear All,

I have  textbox in my form .. I enter the student name in the text e.x
(vbstudent)

I want to sign textbox data to array, each letter in one index.

ex
array(0)=v
array(1)=b
array(2)=s
array(3)=t
array(4)=u
array(5)=d
array(6)=e
array(7)=n
array(8)=t

How can I do that .. please reply me soon.

Thanks for your cooperation

As it seems it's same as that thread:
http://groups.google.com/group/micr.../browse_thread/thread/63953b2aba3cbed0?hl=en#

However, you can create a char array and assign the values of array
usin ToCharArray method as follows:

' Textbox1 is your textbox name
Dim arr() As Char = TextBox1.Text.ToCharArray

'Prove output is same as your example
For x As Integer = 0 To arr.Length - 1
MsgBox("array(" & x & ")=" & arr(x).ToString)
Next

Hope this helps,

Onur Güzel
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top