How to remove string from a specified position in vb

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • govind161986
    New Member
    • Dec 2009
    • 21

    How to remove string from a specified position in vb

    Dear All,

    I have one data like 123, 456, 789,
    now I want to remove the last , how to do that?

    Please help me in this regard,

    Thanks and regards,

    Govind
  • tlhintoq
    Recognized Expert Specialist
    • Mar 2008
    • 3532

    #2
    Move the cursor to the end of the row...
    Hit the backspace key 4 times.

    Are you saying you have a string of "123, 456, 789, "?
    And that you only need part of that string?
    Retrieves a substring from this instance. This member is overloaded. For complete information about this member, including syntax, usage, and examples, click a name in the overload list.

    Comment

    • govind161986
      New Member
      • Dec 2009
      • 21

      #3
      Originally posted by tlhintoq
      Move the cursor to the end of the row...
      Hit the backspace key 4 times.

      Are you saying you have a string of "123, 456, 789, "?
      And that you only need part of that string?
      http://msdn.microsoft.com/en-us/libr...ng(VS.71).aspx
      Thanks for your reply, but I tried some logic and it worked.
      This is what I did

      Dim leng As Integer ''The variable which holds the total length of data
      leng = Trim(Request.It em("Action2")) ''This is the hidden variable from which i get the value which contains ","
      Dim actdata = Left(Trim(Reque st.Item("Action 2")), leng - 1)

      this removes the last comma.

      Comment

      Working...