Right and Left

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • John

    #1

    Right and Left

    Hi

    Why can't I use Right and Left string functions in vb anymore?

    Thanks

    Regards


  • =?Utf-8?B?U3VydHVyWg==?=

    #2
    RE: Right and Left

    You can but in a Windows Form they get shadowed by the .Left and .Right
    properties of the form. It's quite annoying.

    You have a few options:
    1) (my preferred) Use Mid() instead
    2) Type Microsoft.Visua lBasic.Left("ab cdef",1) instead
    3) Create a function VBLeft() which calls Microsoft.Visua lBasic.Left

    Right() is the one you'll miss.

    --
    David Streeter
    Synchrotech Software
    Sydney Australia


    "John" wrote:
    Hi
    >
    Why can't I use Right and Left string functions in vb anymore?
    >
    Thanks
    >
    Regards
    >
    >
    >

    Comment

    • Armin Zingler

      #3
      Re: Right and Left

      "SurturZ" <surturz@newsgr oup.nospamschri eb
      You can but in a Windows Form they get shadowed by the .Left and
      .Right properties of the form. It's quite annoying.
      >
      You have a few options:
      1) (my preferred) Use Mid() instead
      2) Type Microsoft.Visua lBasic.Left("ab cdef",1) instead
      3) Create a function VBLeft() which calls Microsoft.Visua lBasic.Left
      TheString.SubSt ring(0, ...) 'however, not 100% equal
      Right() is the one you'll miss.

      Or use Microsoft.Visua lBasic[.Strings].Right



      Armin

      Comment

      • =?Utf-8?B?RmFtaWx5IFRyZWUgTWlrZQ==?=

        #4
        RE: Right and Left

        I believe you could do this at the top of your class:

        Imports MVB = Microsoft.Visua lBasic

        then in your code:

        a = MVB.Left("abcde f",1) 'for example



        "SurturZ" wrote:
        You can but in a Windows Form they get shadowed by the .Left and .Right
        properties of the form. It's quite annoying.
        >
        You have a few options:
        1) (my preferred) Use Mid() instead
        2) Type Microsoft.Visua lBasic.Left("ab cdef",1) instead
        3) Create a function VBLeft() which calls Microsoft.Visua lBasic.Left
        >
        Right() is the one you'll miss.
        >
        --
        David Streeter
        Synchrotech Software
        Sydney Australia
        >
        >
        "John" wrote:
        >
        Hi

        Why can't I use Right and Left string functions in vb anymore?

        Thanks

        Regards

        Comment

        • Herfried K. Wagner [MVP]

          #5
          Re: Right and Left

          "SurturZ" <surturz@newsgr oup.nospamschri eb:
          You can but in a Windows Form they get shadowed by the .Left and .Right
          properties of the form. It's quite annoying.
          >
          You have a few options:
          1) (my preferred) Use Mid() instead
          2) Type Microsoft.Visua lBasic.Left("ab cdef",1) instead
          3) Create a function VBLeft() which calls Microsoft.Visua lBasic.Left
          I simply qualify the function call with the module containing it:
          'Strings.Left'.

          --
          M S Herfried K. Wagner
          M V P <URL:http://dotnet.mvps.org/>
          V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

          Comment

          • CMoya

            #6
            Re: Right and Left

            "Herfried K. Wagner [MVP]" <hirf-spam-me-here@gmx.atwrot e in message
            news:ulgs%23J$U IHA.3556@TK2MSF TNGP02.phx.gbl. ..
            "SurturZ" <surturz@newsgr oup.nospamschri eb:
            >You can but in a Windows Form they get shadowed by the .Left and .Right
            >properties of the form. It's quite annoying.
            >>
            >You have a few options:
            >1) (my preferred) Use Mid() instead
            >2) Type Microsoft.Visua lBasic.Left("ab cdef",1) instead
            >3) Create a function VBLeft() which calls Microsoft.Visua lBasic.Left
            >
            I simply qualify the function call with the module containing it:
            'Strings.Left'.
            >
            Wow... glad I stumbled over this post. Thank you Herfried. I've been doing
            Microsoft....ya da.Left() for years in WinForms modules and never really
            realized the Strings.Left() option. Much more elegant! Thanks!
            --
            M S Herfried K. Wagner
            M V P <URL:http://dotnet.mvps.org/>
            V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

            Comment

            Working...