1

I am fetching some results from the database :

@log_detail = connection.execute("SELECT logs,setup FROM mastertest WHERE test_ins_id LIKE blah blah blah");

Results

 logs = a/atf/something
 setup = tb-1-atf with ac-2115 

I want

logs = atf/something
setup = 2115

I tried the following for the logs, but it doesn't seem to work

@log_detail.each do |row|
    row[0] = row[0].drop(2) 
end

1 Answer 1

1

Try:

row[0] = row[0][2..-1]

And have a look at the [] method on String.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.