How to extract the last few digits of any numeric String

Hi All,

I have a requeirement where I need to extract the last 4 or 6 digits of a numeric string.

For Example: I have property name and value as TicketNumber = 0005234567891234. The length of value will be any.

Here I want to extract the last 4 digits into a property, let say as Last4Digit = 1234 and also want to extract 6 digits, let say as Last6Digit =891234.

Please do let me know, how can I achieve it.

@MuzzuShaik Hi Can you please look into the below links and check if it is useful.

If this is not useful please check the attached screenshot for a logic

@MuzzuShaik You can use below method

Substring ( Given String, Length of Given String - 4 ) To get last 4 four digits

and for 6 digits, replace 4 with 6.

@SanthoshRanga Thank you it works