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

python - How do I create a list index that loops through integers in another list -

c# - “System.Security.Cryptography.CryptographicException: Keyset does not exist” when reading private key from remote machine -