locked
Store a Textbox Value in array format RRS feed

  • Question

  • Sir

    I want to store My Textbox values in single Array Format. For example  If my Textbox Value is "EXAMPLE" then i want to store this value in array format. array(0) = E, Array(1) = X, array(2) = A, array(3) = M and so on. 

    Thanks

    Thursday, July 31, 2014 11:33 AM

Answers

  • A string is already an array of characters.

    Module Module1
        Sub Main()
            For Each x As Char In "EXAMPLE"
                Console.WriteLine(x)
            Next
            Console.ReadLine()
        End Sub
    End Module


    Success
    Cor

    • Proposed as answer by Tyler.Olson Thursday, July 31, 2014 6:33 PM
    • Marked as answer by Leo (Apple) Yang Thursday, August 7, 2014 6:39 AM
    Thursday, July 31, 2014 11:52 AM
  • A string is already an array, so it is simple

           'Have some text in the textbox
            TextBox1.Text = "CrazyPennie"
    
            'Put the text in an string, (this is already an array
            Dim Txt As String = TextBox1.Text
    
            'get the third letter from the array
            Dim C As Char = Txt(2)
    


    Thursday, July 31, 2014 2:14 PM

All replies

  • A string is already an array of characters.

    Module Module1
        Sub Main()
            For Each x As Char In "EXAMPLE"
                Console.WriteLine(x)
            Next
            Console.ReadLine()
        End Sub
    End Module


    Success
    Cor

    • Proposed as answer by Tyler.Olson Thursday, July 31, 2014 6:33 PM
    • Marked as answer by Leo (Apple) Yang Thursday, August 7, 2014 6:39 AM
    Thursday, July 31, 2014 11:52 AM
  • A string is already an array, so it is simple

           'Have some text in the textbox
            TextBox1.Text = "CrazyPennie"
    
            'Put the text in an string, (this is already an array
            Dim Txt As String = TextBox1.Text
    
            'get the third letter from the array
            Dim C As Char = Txt(2)
    


    Thursday, July 31, 2014 2:14 PM