none
Left Function (VBScript) RRS feed

  • Question

  • How do I build an expression from which the leftmost characters returned vary in length?

    For example:

    Main St

    Hollywood Blvd

    I want just:

    Main

    Hollywood

    Tuesday, October 25, 2016 5:32 PM

All replies

  • Hello,

    I assume the "expression" means regular expression, right? In this case here it is ...

    ([^\s]+)

    Hope this helps,


    Slava Ivanov

    Tuesday, October 25, 2016 7:04 PM
  • There are two ways.

    Msgbox Left("Hollywood Bvl", Instr("HolyWood Bvl", " "))

    Or

    Msgbox Split("Hollywood bvl", " ")(0)


    David Candy

    Saturday, November 5, 2016 7:50 PM
  • There are two ways.

    Msgbox Left("Hollywood Bvl", Instr("HolyWood Bvl", " "))

    Msgbox Split("Hollywood bvl", " ")(0)


    David Candy

    Saturday, November 5, 2016 7:51 PM