module SQLite3ExtendFunction::Functions::Btrim

SQLite3ExtendFunction::Functions::Btrim

Public Class Methods

call(text, chrs = '') click to toggle source

@param [String] text @param [String] chars @return [String] @raise [SQLite3::SQLException]

# File lib/sqlite3_extend_function/functions/btrim.rb, line 12
def call(text, chrs = '')
  text.sub(/\A[#{chrs}]*/, '').sub(/[#{chrs}]*\z/, '')
rescue ArgumentError
  raise SQLite3::SQLException, 'No function matches the given name and argument types. ' \
    'You might need to add explicit type casts.'
end