Getting Textbox data into an Array: VB 2008

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • =?Utf-8?B?dmJTdHVkZW50?=

    #1

    Getting Textbox data into an Array: VB 2008

    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

  • kimiraikkonen

    #2
    Re: Getting Textbox data into an Array: VB 2008

    On Oct 20, 3:10 am, vbStudent <vbStud...@disc ussions.microso ft.com>
    wrote:
    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:


    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.T oCharArray

    '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

    Comment

    Working...