That's because '9' character is not followed by '10' character:

'9'.succ(); // => ':' (not '10')

numbers on the other hand work as "expected":

(9).succ(); // => 10

The solution is simple:

$R(9,14).map(function(n) { return 'tester_' + n; });
// returns ["tester_9", "tester_10", "tester_11", "tester_12",
"tester_13", "tester_14"]


Best,
kangax


On Apr 10, 6:35 pm, ohneworte <[EMAIL PROTECTED]> wrote:
> Hello together,
>
> look at Chapter 17 in the PDF-documentation ("ObjectRange"), you can
> find something like this:
>
> $A($R(1, 5)).join(', ');
>  = '1, 2, 3, 4, 5' - WORKING!
>
> $A($R('tester_1', 'tester_5')).join(', ');
>  = 'tester_1, tester_2, tester_3, tester_4, tester_5' - WORKING!
>
> $A($R('tester_9', 'tester_14')).join(', ');
>  = '   ' - NOT WORKING!
>
> Seems like that method cannot parse string+integer combination higher
> than 9. Any ideas why and solutions? Thanks!
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Spinoffs" group.
To post to this group, send email to rubyonrails-spinoffs@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to