Split String by last

HI All,

Can anyone suggest me on below split

Input= Hi_I_want_to_split.xlsx
expected output=Hi_I_want_to

no. of underscore is not fixed. I need all text of last underscore

1 Like


Try below expression.

           Input.SubString(0, Input.LastIndexOf("_"c))

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.