Thursday 4 April 2019

Get the first word after a specified string

    Dim sa As String
    Dim s As String
    Dim sp() As String
    sa = TextBox1.Text  //this text box contains value **Open Ended Schemes(Debt Scheme - Banking and PSU Fund)**
    sp = sa.Split("(")  //Here u get the output as **Debt Scheme - Banking and PSU Fund)** which means content after the open bracket...
    sp = sp(1).Split(")")  //Here u get the output as Debt Scheme - Banking and PSU Fund which means content till the close bracket...
    s = Split(sp(0))(0)  //Here it will take the first word, which means u will get the output as **Debt**
    s = Split(sp(0))(1)  //Change the index as per the word u want, here u get the output as **Scheme**

No comments:

Post a Comment