From: Benedikt Müller on 26 Feb 2010 08:30 Hi I want to âcountâ a string. I don't know, how to express it better, because of that I'll try to explain it. I have a string, say 'a'. Now I want to increase it, so it would be 'b'. I increase it again, it would be 'c' and so on. Is there a method for this task? -- GruÃ, Benedikt
From: Alexander Jesner on 26 Feb 2010 08:33 On 02/26/2010 14:30, Benedikt Müller wrote: > Hi > I want to „count“ a string. I don't know, how to express it better, > because of that I'll try to explain it. I have a string, say 'a'. Now > I want to increase it, so it would be 'b'. I increase it again, it > would be 'c' and so on. > Is there a method for this task? > > Try: "a".succ => "b" Regards
From: Wybo Dekker on 26 Feb 2010 08:34 >irb >> x='a' => "a" >> x.next! => "b" >> x.next! => "c" >> x.next! => "d" >> x.next! => "e" >> x.next! => "f" Benedikt Müller wrote: > Hi > I want to „count“ a string. I don't know, how to express it better, > because of that I'll try to explain it. I have a string, say 'a'. Now > I want to increase it, so it would be 'b'. I increase it again, it > would be 'c' and so on. > Is there a method for this task? > -- Wybo
From: Benedikt Müller on 26 Feb 2010 08:37 thx Sorry I looked in ruby-doc in the String class but I didn't saw it so I thought that isn't in the standard lib. :( -- GruÃ, Benedikt
From: Benedikt Müller on 26 Feb 2010 09:46 Is there a possibility to say what chars can be in the string? I want to have upper chars and lower chars but i want to start with only one char. -- GruÃ, Benedikt
|
Pages: 1 Prev: Class Function call vs Normal Function call Next: Installing Pg gem for PostGreSQL 8.4 |