# Re: How do I strip off the extra double quote or white space

**URL:** <https://www.ruby-forum.com/t/re-how-do-i-strip-off-the-extra-double-quote-or-white-space/66179>\
**Category:** Ruby\
**Created:** [August 23, 2006, 8:58pm UTC](https://www.ruby-forum.com/t/re-how-do-i-strip-off-the-extra-double-quote-or-white-space/66179 "2006-08-23T20:58:20Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ban\_Hoang](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/9fc348/32.png) [@Ban\_Hoang](https://www.ruby-forum.com/u/Ban_Hoang)\
**Post date:** [August 23, 2006, 8:58pm UTC](https://www.ruby-forum.com/t/re-how-do-i-strip-off-the-extra-double-quote-or-white-space/66179/1 "2006-08-23T20:58:20Z")

</div>

Actually the input file contain is on the same 1st line : arr[0]

* * *

* * *

This is the csv external file dropList.csv contain:

:: Select Site :: !!Eastgate\_Mall

* * *

I think my actual problem is when reading into an array and compare, it  
did not separate :: Select Site :: as one field and ::  
!!Eastgate\_Mall to another field.

That why the expect is \<[":: Select Site ::,!!Eastgate\_Mall,\n"]  
( missing separate double quotes)

Instead of \<[":: Select Site ::", “!!Eastgate\_Mall”]\>.

Any one have any idea that I can separate the fields and make it work  
with double quotes?

Thanks a lot!

* * *

From: Ban Hoang  
Sent: Wednesday, August 23, 2006 9:27 AM  
To: ‘removed\_email\_address@domain.invalid’  
Cc: ‘removed\_email\_address@domain.invalid’; ‘removed\_email\_address@domain.invalid’  
Subject: How do I strip off the extra double quote or white space in the  
string when using assert\_equal method

Hi,

I try to read in an external file to array and compare them to the drop  
down list in our application. I got into the problem when comparing, the  
extra double quotes make the assertion result failed. Can anyone help me  
to make it work?

Thanks for your help,

ps . I posted this question on Nabble but it is pending without reason  
so I try to post it here hope it can go to the list users…

* * *

Below is the code:

* * *

arr = IO.readlines(“dropList.csv”) # read entire contents of the file  
into a single array. Each index of the array is one line.

assert\_equal([arr[0]], $ie.frame(“top”).select\_list(:name,  
“site\_id”).getAllContents)

* * *

This is the csv external file dropList.csv contain:

## :: Select Site :: !!Eastgate\_Mall

1. Failure:

test\_\_02\_DropDown\_list\_verified(TC\_pulldownBoxVerified)  
[DropVerified\_test.rb:45]:

\<[":: Select Site ::,!!Eastgate\_Mall,\n"]\> expected but was

\<[":: Select Site ::", “!!Eastgate\_Mall”]\>.
