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

android - Why am I getting the message 'Youractivity.java is not an activity subclass or alias' -

Making Empty C++ Project: General exception (Exception from HRESULT:0x80131500) Visual Studio Community 2015 -

How to fix java warning for "The value of the local variable is not used " -