Results 1 to 4 of 4

Thread: Parsing a String

  1. #1

    Thread Starter
    New Member
    Join Date
    Jul 2001
    Location
    Alberta, CA
    Posts
    11

    Parsing a String

    Hi,

    I was wondering if anyone could give me a little direction in parsing a string (a phrase) into indivdual characters and then loading those individual characters into a control array of labels.

    Can I do this using the Mid control?

  2. #2
    Frenzied Member nishantp's Avatar
    Join Date
    Jan 2001
    Location
    Where you least expect me to be
    Posts
    1,375
    k i wrote u a function that returns an array containing each letter of a string in one element. Requires VB6.
    VB Code:
    1. Function LetterArray(strText As String) As String()
    2.     Dim i As Long
    3.     Dim lngLen As Long
    4.     Dim aryOut() As String
    5.     lngLen = Len(strText)
    6.     ReDim aryOut(lngLen)
    7.     For i = 0 To lngLen
    8.         aryOut(i) = Mid(strText, i + 1, 1)
    9.     Next
    10.     LetterArray = aryOut
    11. End Function
    You just proved that sig advertisements work.

  3. #3

    Thread Starter
    New Member
    Join Date
    Jul 2001
    Location
    Alberta, CA
    Posts
    11
    Thank you!

  4. #4
    Frenzied Member nishantp's Avatar
    Join Date
    Jan 2001
    Location
    Where you least expect me to be
    Posts
    1,375
    You just proved that sig advertisements work.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width