There's nothing special about letters verses punctuation in the above
code. Are you talking about the quotes that surround the string; i.e.,
string = "this is a string" ?
···
On Wed, Jun 13, 2012 at 6:15 AM, Michael Sung <lists@ruby-forum.com> wrote:
Hello,
Is there a way to capture " (quotation marks) when you use the
chars.to_a command?
Have you escaped the double-quotation mark " with a back-splash like "I
escape the \" with a back splash" ? Or, you can try other delimiters
like quotation mark ' or use a word array instead, like %w{this is an
word array}.
1. I'd not call arrays "strings". It's confusing. "newString" isn't a
string here.
2. Why is "string[length]" surrounded by "" ? This creates an array
of 1-element arrays. Is this what you want?
3. you first take the element string[string.length]. This is nil. Is
this what you want?
On Thu, Jun 14, 2012 at 07:08:33PM +0900, Scott W. wrote:
Have you escaped the double-quotation mark " with a back-splash like "I
escape the \" with a back splash" ? Or, you can try other delimiters
like quotation mark ' or use a word array instead, like %w{this is an
word array}.