How to take specific digits from given number using regex?

Hi All,

I want to take out specific three digits from given number. Looking for quick help.
Number is 51599710050269 Output is 997.

Hi,

For regex there should be some pattern then only we will be able to achieve do you see any pattern of this number.

Is the requirement always get three digits starting from fourth digit. If that is the case we can convert this integer to string and we can use simple substring method to extract the desired digits.

Please try below. Thanks

Yourdigits.tostring.substring(3,3)

@Pavan_Kalyan_Konda

Welcome to forums

Check below for your reference

image

Hope this will help you

Thanks

1 Like

thanks for quick help.

1 Like

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