Removing a Character and the end of a string

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • JHNielson
    New Member
    • Feb 2007
    • 121

    Removing a Character and the end of a string

    I have a VB code that generates a string. I need to remove the last character from the string - it is a ")".

    I was trying to use the left command, but because it is a variable length string, i can't assign ONE number for the Left(....,#).

    Any suggestions? Ideas?


    Thanks
  • Arnold Schuur
    New Member
    • Apr 2007
    • 36

    #2
    Code:
    strYourString = Mid(strYourString, 1, Len(strYourString)-1)

    Comment

    • Killer42
      Recognized Expert Expert
      • Oct 2006
      • 8429

      #3
      Arnold is correct. But personally, I believe I would go with your original idea of using Left() function. Just substitute Len(strYourStri ng)-1 as he has done. There's no difference in functionality and likely to be no difference in performance, so why bother with the extra parameter?

      Comment

      Working...