Skip to content

Are multiple alternate solutions acceptable? #10

@kytrinyx

Description

@kytrinyx

@value = "bobcat"

Remove 'bob' from this string in order to return a much tamer version.

Use a non-destructive method to remove 'bob' from this string and return "cat":

>> @value.sub("bob", "")

Not yet...

I would expect any of these (and more) to work:

  • @value.sub("bob", "")
  • @value.gsub("bob", "")
  • @value.tr("bo", "")
  • @value[3..-1]
  • @value.gsub(/[bo]/, '')
  • etc

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions