C
Christopher Causer
This seems like an easy question but I cannot find any documentation on
it anywhere on the web.
I want to write a script that will count the number of dollars in a
string, excluding escaped dollars (ie. "\$".) My first hack was to use
split and count the number of elements in the array, but I came unstuck
trying to exclude \$. Surely there's a nice simple elegant solution?
I'm very (as in this morning) new to Ruby so apologies if this is a
trivial question and I'm posting on the wrong forum.
Chris
it anywhere on the web.
I want to write a script that will count the number of dollars in a
string, excluding escaped dollars (ie. "\$".) My first hack was to use
split and count the number of elements in the array, but I came unstuck
trying to exclude \$. Surely there's a nice simple elegant solution?
I'm very (as in this morning) new to Ruby so apologies if this is a
trivial question and I'm posting on the wrong forum.
Chris