Extract Partial String

Hi,

I have a string and I want to extract part of it. For eg if my string is 104701123456001.I want to extract the string between 5th and last 3 characters. Hence my output should be 01123456

Can someone please help. Sorry I am bad at programming.

@mohammedamaan,

Try like this,

str.Substring(4,8)
2 Likes

@mohammedamaan
Str= 104701123456001
OpStr=Str.Substring(4,8)

1 Like

hi @mohammedamaan

if the index are constant means staring from 5th and till last but 3rd character then use the below expression,

result = InputString.Substring(4,InputString.Length-3-4)

Regards
Ajay

3 Likes

Thanks. It worked.

1 Like

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