fork download
  1. s = "abcdef"
  2. w = "ef"
  3. t = s.sub(/#{w}\z/, "")
  4.  
  5. puts t
Success #stdin #stdout 0.01s 5888KB
stdin
Standard input is empty
stdout
abcd