Results 1 to 3 of 3

Thread: [RESOLVED] [2008] Splitting a String

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Apr 2007
    Posts
    86

    Resolved [RESOLVED] [2008] Splitting a String

    Hi All.

    I am wondering if it is possible to take a string, split it at a certain character and then put the 2 parts in different text boxes.

    For example:

    String: PCNAME%Message

    Textbox1: PCNAME

    Textbox2: Message

    thanks in advanced.

  2. #2
    Powered By Medtronic dbasnett's Avatar
    Join Date
    Dec 2007
    Location
    Jefferson City, MO
    Posts
    9,897

    Re: [2008] Splitting a String

    Code:
            Dim s As String = "PCNAME%Message"
            Dim parts() As String
            parts = s.Split("%"c)
            Debug.WriteLine(parts(0))
            Debug.WriteLine(parts(1))
    My First Computer -- Documentation Link (RT?M) -- Using the Debugger -- Prime Number Sieve
    Counting Bits -- Subnet Calculator -- UI Guidelines -- >> SerialPort Answer <<

    "Those who use Application.DoEvents have no idea what it does and those who know what it does never use it." John Wein

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Apr 2007
    Posts
    86

    Re: [2008] Splitting a String

    Brilliant that worked a treat! Thanks!

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