none
Missing Right and Left String Functions RRS feed

  • Question

  • I have lost my Right and Left string functions. 

    Mid is still present, but Right and Left now refer to the distance in pixels from the edge of a control. 

    How can I get my string functions back again?

    Friday, February 10, 2006 7:26 PM

Answers

  • Dim a As String = "now is the time"

    Dim b As String = Microsoft.VisualBasic.Strings.Right(a, 5)

    Saturday, February 11, 2006 1:09 AM

All replies

  • they should be in the Microsoft.VisualBasic assembly. is that referenced?

    Friday, February 10, 2006 8:41 PM
    Moderator
  • try Microsoft.VisualBasic.Left(s,1)

    also you can use the String.Substring function

    dim s as string = "foobar"

    dim sLeft2 as string = s.Substring(0, 2)

    dim sRight2 as string = s.Substring(s.Length-2)

    Friday, February 10, 2006 8:44 PM
    Moderator
  • Thank you for your response!

    Microsoft.VisualBasic is checked on the Project References panel.  (VB 2005 Express). 

    I have References to System, System.data, System.Drawing, System.Windows.Forms, System.Xml, and Windows Media Player (AxInterop and Interop .WMPLib.dll)

    Regards,

    Dave M

    Friday, February 10, 2006 11:11 PM
  • Yes, I did something like this.  But I am puzzled as to what happened to Right and Left.

    Regards,

    Dave M

    Friday, February 10, 2006 11:12 PM
  • Dim a As String = "now is the time"

    Dim b As String = Microsoft.VisualBasic.Strings.Right(a, 5)

    Saturday, February 11, 2006 1:09 AM
  • That does the trick.  Thank you!!
    Monday, February 13, 2006 4:22 PM
  •  

    You're welcome and remember ....

    THE OBJECT BROWSER IS YOUR FRIEND !!!!!!!!

    Monday, February 13, 2006 4:53 PM