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' -

Google sheets equipment borrowing system -

c# - Convert type 'System.Collections.Generic.List<string>' to 'System.Collections.Generic.IList<>' -