module Byebug::Helpers::StringHelper - byebug-11.0.1 Documentation

# module Byebug::Helpers::StringHelper

Utilities for interaction with strings

### Public Instance Methods

camelize(str) click to toggle source

Converts `str` from an_underscored-or-dasherized_string to ACamelizedString.

    # File lib/byebug/helpers/string.rb, line 13
    def camelize(str)
      str.dup.split(/[_-]/).map(&:capitalize).join("")
    end

deindent(str, leading_spaces: 6) click to toggle source

Removes a number of leading whitespace for each input line.

    # File lib/byebug/helpers/string.rb, line 28
    def deindent(str, leading_spaces: 6)
      str.gsub(/^ {#{leading_spaces}}/, "")
    end

prettify(str) click to toggle source

Improves indentation and spacing in `str` for readability in Byebug's command prompt.

    # File lib/byebug/helpers/string.rb, line 21
    def prettify(str)
      "\n" + deindent(str) + "\n"
    end