Results 1 to 5 of 5

Thread: Colon seperate

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Jan 2009
    Posts
    138

    Colon seperate

    Hello everybody...
    I have for example this text:

    User:text Something xxx

    And I want to program seperate only word "text"

    So, word after colon and before first space.
    I'm interested in code, thanks!

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

    Re: Colon seperate

    Show us what you have done so far.
    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
    Addicted Member
    Join Date
    Jan 2009
    Posts
    138

    Re: Colon seperate

    I had not done anything about it so far.

  4. #4
    PowerPoster motil's Avatar
    Join Date
    Apr 2009
    Location
    Tel Aviv, Israel
    Posts
    2,143

    Re: Colon seperate

    try this:

    Code:
    Dim txb As String = TextBox1.Text
            txb = txb.Substring(txb.IndexOf(":") + 1, txb.IndexOf(" ") - txb.IndexOf(":"))
    * Rate It If you Like it

    __________________________________________________________________________________________

    "Programming is like sex: one mistake and you’re providing support for a lifetime."

    Get last SQL insert ID

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

    Re: Colon seperate

    You really should try and ask a question based on the code you have. For simple things like this it is not such a big deal, but if you have bigger problems...

    Code:
            Dim foo As String = "User:text Something xxx"
            Dim splitColon() As String = foo.Split(New Char() {":"c})
            Dim splitSpace() As String = splitColon(1).Split(New Char() {" "c})
            Debug.WriteLine(splitSpace(0))
    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

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