M
Minkoo Seo
Hi group.
I'd like to substitute every quotation mark ` with whitespace. But, I
don't want to substitue "`" which is used for the purpose of
abbreviation.
Example>
I'm not a girl => I'm not a girl
`Hello world' => Hello world'
I've written the following for this purpose:
irb(main):003:0> s = "they can't prove I did `hello world'"
=> "they can't prove I did `hello world'"
irb(main):004:0> loc = (s =~ / `[a-z|A-Z]/)
=> 22
irb(main):005:0> s[loc + 1, 1] = ' '
=> " "
irb(main):006:0> s
=> "they can't prove I did hello world'"
irb(main):007:0>
But this seems to be unawkard because of loc = ( s =~ ...) which
contains seemingly two "="s. Is there another way to do this? If so,
please let me know.
Sincerely,
Minkoo Seo
I'd like to substitute every quotation mark ` with whitespace. But, I
don't want to substitue "`" which is used for the purpose of
abbreviation.
Example>
I'm not a girl => I'm not a girl
`Hello world' => Hello world'
I've written the following for this purpose:
irb(main):003:0> s = "they can't prove I did `hello world'"
=> "they can't prove I did `hello world'"
irb(main):004:0> loc = (s =~ / `[a-z|A-Z]/)
=> 22
irb(main):005:0> s[loc + 1, 1] = ' '
=> " "
irb(main):006:0> s
=> "they can't prove I did hello world'"
irb(main):007:0>
But this seems to be unawkard because of loc = ( s =~ ...) which
contains seemingly two "="s. Is there another way to do this? If so,
please let me know.
Sincerely,
Minkoo Seo