Skip to content

Instantly share code, notes, and snippets.

@ndeto
Created September 23, 2021 04:55
Show Gist options
  • Save ndeto/6f9b4b2b8637dda8e10a1e592c4547ce to your computer and use it in GitHub Desktop.
Save ndeto/6f9b4b2b8637dda8e10a1e592c4547ce to your computer and use it in GitHub Desktop.
Clean Backslashes
# Clean backslash characters
def clean_str(str)
new_str = []
str.chars.each do |char|
if char == "\\"
next
end
new_str << char
end
new_str.join("")
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment