string - Ruby: extract substring between 2nd and 3rd fullstops -


i constructing program in ruby requires value extracted between 2nd , 3rd full-stop in string.

i have searched online various related solutions, including truncation , prior stack-overflow question: get value between 2nd , 3rd comma, no answer illustrated solution in ruby language.

thanks in advance.

list = my_string.split(".") list[2] 

that think. first command splits list. second gets bit want


Comments

Popular posts from this blog

sql - VB.NET Operand type clash: date is incompatible with int error -

SVG stroke-linecap doesn't work for circles in Firefox? -

python - TypeError: Scalar value for argument 'color' is not numeric in openCV -