Extract specific Substring from a string

Hello all,

I want to get a substring “1234659” from String variable : “000000001234659100”.

please help with the syntax for extracting the substring.

@Yugal_Raju

strVariable.Substring(strVariable.IndexOf(“1234659”), 7)

or

yourStringVariable.Substring(yourStringVariable.IndexOf(“1”), 7)

@Yugal_Raju

StringVal.Substring(8,7)

Hi @Yugal_Raju

strVariable.TrimStart("0"c).TrimEnd("0"c)

HI @Yugal_Raju

Use the below syntax

Input.TrimStart("0"c) 

Input.TrimEnd("0"c)



Regards

Hi @Yugal_Raju

You can use the below expression by Substring,

- Input = "000000001234659100"

- Output = Input.Substring(8,7)

Check the below workflow for better understanding,

Hope it helps!!

Hi,

you can use below expression.

originalString.Substring(originalString.IndexOf(“1234659”), 7)

Hi @Yugal_Raju

StrInput= "000000001234659100"

Try this

StrInput.TrimStart("0"c).TrimEnd("0"c)

Output= 12346591

OR

StrInput.Substring(8,7)

Output= 1234659

Hope it will helps you :slight_smile:
Cheers!!

It is working,

Thank you

It’s my pleasure… @Yugal_Raju

Happy Automation!!

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