Get substring after the first = symbol in Ruby
split (char) is another function which can be used. For instance, we want to get substring before char ':' from "answer:computer" then, we can use "answer:computer".split (':') [0] .So, we would get result as "answer". Instead of using string.split ('=', 2) [1] you could use array decomposition.