Results 1 to 4 of 4

Thread: [2005] RemoveTextbox

  1. #1

    Thread Starter
    Learning .Net danasegarane's Avatar
    Join Date
    Aug 2004
    Location
    VBForums
    Posts
    5,853

    Thumbs up [2005] RemoveTextbox

    Hi all,
    I have a textbox with values as ";1;2;3;" and may be "1"
    I want to remove either 1 or 2 or 3 with the ; symbol.Please note that the value may be without ; , if it is single value

    Thanks in Advance
    Dana
    Please mark you thread resolved using the Thread Tools as shown

  2. #2
    PowerPoster RhinoBull's Avatar
    Join Date
    Mar 2004
    Location
    New Amsterdam
    Posts
    24,132

    Re: [2005] RemoveTextbox

    I'm using two textboxes for demonstration only so change it as necessary:
    Code:
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        TextBox2.Text = StripCharacter(TextBox1.Text, "1;")
    End Sub
    
    Private Function StripCharacter(ByVal source As String, ByVal mychar As String) As String
    Dim result As String
    
        If source.IndexOf(mychar) >= 0 Then
            result = source.Substring(source.IndexOf(mychar) + mychar.Length)
        Else
            result = source
        End If
    
        Return result
    
    End Function

  3. #3

    Thread Starter
    Learning .Net danasegarane's Avatar
    Join Date
    Aug 2004
    Location
    VBForums
    Posts
    5,853

    Re: [2005] RemoveTextbox

    Dear Rhino,
    Thanks for ur reply.It may not contain ; symbol ?

    Dan
    Please mark you thread resolved using the Thread Tools as shown

  4. #4

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