How can I extract a particular number from the below array values between two underscores
names = [ "create_sales_3920_7873","create_sales_49204_7873","create_sales_392_7873"]
How to get output result as 3920, 49204, 392 from the above array
Any help is appreciable
If the actual
names
array is quite long I'm sure there's a better way to do this, but looping over the array and using split will get the job done for the example you've posted: