Substring from Right to left

Hi Team,

I have multiple string with date Eg. “ABC_26022021”, “ABCD_06022021”,“DEFE_02022021” I want to do substring from right to left indexing(0,10) and remaining value I want to store in diff. Variable. like
“ABCD_06022021” - Input and “AB” is new value
“DEFE_02022021”- input and “DE” is new value
“ABC_26022021” - input and “A” is new value
make sure i want to do substring of right to left side of (0,10)

1 Like

Hello @Pramod_Sharma ,

Try like this strVar= “ABCD_06022021”.Substring(0,2)


I want from right to left if i put value “ABC_20102021” it will give me an out put “AB” but i want out put only “A”


In this case you can check with the length of the string and keeping IF condition, check as below

Hope this helps you



Check this single line of code, @Pramod_Sharma
Hope this may help you :slight_smile: