Issue in splitting a string

there’s a string - “Jeevan Kumar Das_BCET/14EEE07.pdf”

n i want to print only “14EEE07”

So “ipstr1”=is variable name

heres the expression i have written- “ipstr1.Substring(ipstr1.IndexOf(“14”))”

it prints 14EEE07.pdf
but when im trying to add more expression i.e “split” to separete “14EEE007”

but it is giving me errors
Please provide me a good sollution

Thanks is advance

Hi @Jiban_Kumar_Das

Try this

System.Text.RegularExpressions.Regex.Match(ipstr1, "(?<=\/)\w+").ToString
1 Like


If it solves your problem, mark it as a solution to close the topic.


if you’ll try like this → ipstr1.Substring(ipstr1.IndexOf("14"), 7) it will work

to make it more dynamic use this

ipstr1.Substring(ipstr1.IndexOf("14"), ipstr1.Length-ipstr1.IndexOf("14")-4)

For your Reference

1 Like

now i understood…thanks Sir :slight_smile:

can u tell me how to close this thread ?

by marking the solution. You have already done that.

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