How to split character

Hello everybody
I have data in excel file like this: TS_20180821_apbassln, TS_10180771_apdesignopts, I want to split characters and numbers to be like this apbassln,apdesignopts(starts from the 13th character)
Could you help me with this and thanks a lot

@marwan992 , If this is your string , then you can do that as string.split("_"c).Last() …

You will get this … apbassln

Use this variable=String.Split({"_"c}) then Variable(2).ToString
It will fetch the last name.

this is the whole record and i want only: apbassln

Hi @marwan992,

If the file name format remains the same, the you can use Split function.


This will give you only “apdesignopts” without “.xlsx”

Devbrath Rajkhua

no it is dynamic not static

Even if the file format remains dynamic but has a structure like this ab_12345678_abcdefgh.xlsx, the split function will return abcdefgh.

Devbrath Rajkhua

Hi @marwan992

You can use this -
You will get your output

1 Like

Then you have to use another split…


Here :

  1. string.split("_"c).Last() --> this will give you the output as apbassln.xlsx
  2. split("."c).First() --> this will split again with “.” and give you apbassln …

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