Class: String
- Inherits:
-
Object
- Object
- String
- Defined in:
- lib/string.rb
Overview
Add the sanitize! method to the String class
Instance Method Summary collapse
-
#sanitize ⇒ Object
Sanitize the String completely from memory.
Instance Method Details
#sanitize ⇒ Object
Sanitize the String completely from memory. This is non-reversible.
9 10 11 12 13 14 |
# File 'lib/string.rb', line 9 def sanitize for i in 0...self.length self[i] = 0 end self.delete!("\000") end |