Gsub


#1

hi ,

I have a string with “”. how can i gsub the string?

i tried

“”.gsub(’’,’’)

but it is giving error.

thanks in advance
JK


#2

Frederick C. wrote:

On Dec 24, 11:49�am, Jayakumar Manickam <rails-mailing-l…@andreas-
s.net> wrote:

hi ,

�I have a string with “”. how can i gsub the string?

i tried

“”.gsub(’’,’’)

but it is giving error.

Neither of those string literals because the \ escapes the close quote
mark. You need to escape literal backslashes.

Fred

i tried “\”.gsub(’\’,’’). it is working fine.

thanks


#3

On Dec 24, 11:49 am, Jayakumar Manickam <rails-mailing-l…@andreas-
s.net> wrote:

hi ,

I have a string with “”. how can i gsub the string?

i tried

“”.gsub(’’,’’)

but it is giving error.

Neither of those string literals because the \ escapes the close quote
mark. You need to escape literal backslashes.

Fred