Method: REXML::Functions.substring_before

Defined in:
lib/extensions/rexml/rexml/functions.rb

.substring_before(string, test) ⇒ Object

Kouhei fixed this



160
161
162
163
164
165
166
167
168
# File 'lib/extensions/rexml/rexml/functions.rb', line 160

def Functions::substring_before( string, test )
  ruby_string = string(string)
  ruby_index = ruby_string.index(string(test))
  if ruby_index.nil?
    ""
  else
    ruby_string[ 0...ruby_index ]
  end
end