Results 1 to 8 of 8

Thread: [RESOLVED] [2005] Cut String !

Hybrid View

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

    Re: [RESOLVED] [2005] Cut String !

    hey killer what are you trying to do? Are you trying to remove the | or are you trying to make seperate strings of visual | basic? If the latter see Stanav post.

    Both

    Code:
            Dim testString As String = "Visual | Basic | is | easy"
            Dim foo() As String = testString.Split("|"c)
            Debug.WriteLine("'Debug Output")
            For x As Integer = 0 To foo.Length - 1
                Debug.WriteLine("'" & foo(x))
            Next
            testString = testString.Replace("|", "")
            Debug.WriteLine("'" & testString)
            Stop
            'Debug Output
            'Visual 
            ' Basic 
            ' is 
            ' easy
            'Visual  Basic  is  easy
    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

  2. #2

    Thread Starter
    Fanatic Member
    Join Date
    Jul 2007
    Posts
    530

    Re: [RESOLVED] [2005] Cut String !

    Quote Originally Posted by dbasnett
    hey killer what are you trying to do? Are you trying to remove the | or are you trying to make seperate strings of visual | basic? If the latter see Stanav post.

    Both

    Code:
            Dim testString As String = "Visual | Basic | is | easy"
            Dim foo() As String = testString.Split("|"c)
            Debug.WriteLine("'Debug Output")
            For x As Integer = 0 To foo.Length - 1
                Debug.WriteLine("'" & foo(x))
            Next
            testString = testString.Replace("|", "")
            Debug.WriteLine("'" & testString)
            Stop
            'Debug Output
            'Visual 
            ' Basic 
            ' is 
            ' easy
            'Visual  Basic  is  easy

    I was making it separate

    Code:
    dom strs as String =Textbox1.text
    dim s as String =strs.split("|")
    dim s1,s2 as String 
    
    if s.length > 1 then 
    s1=s(0)
    s2=s(1).TrimStart(" ")
    end if
    Working as Stanav Post

    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