locked
Remove before and after Characters from String using Mid and Instr into VB.Net RRS feed

  • Question

  • User-1797368610 posted

    hi

    i was able to retrieve the first value with the help from this forum. Now i would like to retrieve middle position characters only, in below string how can i retrieve Date Only (11-DEC-2017)?

    002071:11-DEC-2017:1068 Gerard Avenue

    To retrieve the first values i was using below code:

    txtInsp_dt.Text = Mid(Ddl_newproj.SelectedItem.Text, 1, InStr(1, Ddl_newproj.SelectedItem.Text, searchchar, 1) - 1)

    Appreciated for your help!

    Sunday, December 17, 2017 1:41 AM

Answers

  • User-1716253493 posted

    txtInsp_dt.Text = Ddl_newproj.SelectedItem.Text.Split(":")(1)

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Sunday, December 17, 2017 2:30 AM