How to trim a string to get substring elements only?

Hi expert’s,

How to get this output D0007761000000

Example: ip = D00077610000001200

I need to get the output as D0007761000000 need to omit the last 4 digits from the input string…

FYI: it is for each row and the last four digital value will change for each row item.

I tried some codes but it’s not working… :frowning:

Thanks in advance.

Hi

myString = “D00077610000001200”

myString.Substring(myString.Length-4)

Hope this helps

Thanks

1 Like

Hi @vishnu_prasad21,

if you have ip=“D00077610000001200”, then please try with this -

ip.Substring(0,ip.Length-4)

Thanks & Regards,
Apurba

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