Saving a String as a Variable?


How might you make a new redacted string and save it as a variable, rather than just printing it to the console?

Has anyone solved this for themselves?

Replace this line with your code.


One way would be to built a list then return it as a string..

    words.each do |word|
        result = []
        if word != redact
            result.append("REDACTED ")
    return result.join(' ')


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.