Removing Apart Of String

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • BarryM
    New Member
    • Mar 2008
    • 32

    Removing Apart Of String

    Hi a simple questin in got is whythe remove thing doesent always work
    if your starting integer is 0 and ending integer is like 10 its fine
    Code:
    string =  textbox1.text.remove(0,10)
    but if your starting integer is like 47 and last is 57 it wont work. WHY. Could somebody please help me withit
  • debasisdas
    Recognized Expert Expert
    • Dec 2006
    • 8119

    #2
    just check all the over loaded Remove methods with their parameters , you will come to know the simple answer.

    Comment

    • lotus18
      Contributor
      • Nov 2007
      • 865

      #3
      Originally posted by BarryM
      Hi a simple questin in got is whythe remove thing doesent always work
      if your starting integer is 0 and ending integer is like 10 its fine
      Code:
      string =  textbox1.text.remove(0,10)
      but if your starting integer is like 47 and last is 57 it wont work. WHY. Could somebody please help me withit
      Hi

      [CODE=vbnet] string = textbox1.text.r emove(0,10)
      [/CODE]

      This means that 0 is your starting index to remove the characters and 10 is the length or the number of characters to be deleted.

      Rey Sean

      Comment

      • kuzen
        New Member
        • Dec 2006
        • 20

        #4
        you probably got it already from the replies above, whatever, your code will look like this
        Code:
        string=textbox1.text.remove(47,10)
        I presume you wanted to remove char.s with indices 47-57
        the problem you're facing is caused by either the length of your textbox1.text is not 104(47+57) or even if it is, you're removing char.s with indices 47-104

        Comment

        Working...