Ruby - Strings - Methods II

Sort by

recency

|

38 Discussions

|

  • + 0 comments
    def strike(string)
        "<strike>#{string}</strike>"    
    end
    
    def mask_article(string, words_arr)
        words_arr.each do |word|
            string.gsub!(word, strike(word))
        end
        string
    end
    
  • + 0 comments

    Is this good idea to use this script in wordPress website? I'm working on content based wesbite of 2323 Angel Number and I want to use this script for my content blog.

  • + 0 comments

    Here is ruby strings - methods ii problem solution - https://www.gyangav.com/2022/10/hackerrank-ruby-strings-methods-ii-problem-solution.html

  • + 0 comments

    Here are the solution of HackerRank Ruby Strings Methods II Solution you can find All HackerRank Ruby Tutorial solutions in Single Post HackerRank Ruby Tutorial solutions

  • + 0 comments
    def mask_article(string, arr)
        arr.map do |word|
            string.gsub!(word, strike(word)) if string.include? word
        end
        string
    end
    
    public def strike(string)
        "<strike>#{string}</strike>"
    end