Share a string into two strings RRS feed

  • Question

  • Hi,

    I am working on a project and have a problem ...

    Suppose I have this text in a string, "timvisee, hi, this is some text"
    How should I schijden this text in two different strings. In the first string, I would like the name, that is' timvisee "in the second string should" hi, this is some text "will be shown. But the name (timvisee) may change. Also what the thing behind the name is changed to Deren. Only remains always between the name and the text are the following ','. I hope it is clear what I mean.


    Tim Visee

    PS Maybe the spelling is not quite correct because of google translate.
    Thursday, September 16, 2010 11:10 PM


  • try this:


    Public Class Form1
      Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Dim testStr As String = "timvisee, hi, this is some text"
        Dim parts() As String = testStr.Split(New Char() {","c}, 2)
      End Sub
    End Class
    • Proposed as answer by John Anthony Oliver Thursday, September 16, 2010 11:30 PM
    • Marked as answer by Tim Visee Thursday, September 16, 2010 11:37 PM
    Thursday, September 16, 2010 11:20 PM

All replies