Yahoo Answers is shutting down on May 4th, 2021 (Eastern Time) and beginning April 20th, 2021 (Eastern Time) the Yahoo Answers website will be in read-only mode. There will be no changes to other Yahoo properties or services, or your Yahoo account. You can find more information about the Yahoo Answers shutdown and how to download your data on this help page.

VB split function?

how do i use VBs split function to split at multiple parts of a string

example:

stringA = (ABCD)

split(stringA, *****)

with result:

stringA = {A, B, C, D}

2 Answers

Relevance
  • Anonymous
    1 decade ago
    Favorite Answer

    Short answer is for a string of "ABCD" you can't split it into A, B, C and D using Split()

    Split() will split using a char

    sInput = "A,B,C,D"

    arResult = Split(sInput,",")

    For iLoop = 0 To UBound(arResult)

    MsgBox arResult(iLoop)

    Next

    will work however... you need to split using a char

    Your other option is to just loop through the string and assign

    sInput = "ABCD"

    For iLoop = 1 To Len(sInput)

    MsgBox Mid(sInput,iLoop,1)

    Next

    like so... instead of the msgbox assign each char to an array or something

  • Anonymous
    4 years ago

    Vb Split Function

Still have questions? Get your answers by asking now.