Counting a string

B

Benedikt Müller

Hi
I want to =E2=80=9Ecount=E2=80=9C 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?

--=20
Gru=C3=9F, Benedikt
 
A

Alexander Jesner

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
 
W

Wybo Dekker

irb=> "f"

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?
 
B

Benedikt Müller

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.
:(

--=20
Gru=C3=9F, Benedikt
 
B

Benedikt Müller

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.

--=20
Gru=C3=9F, Benedikt
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,159
Messages
2,570,879
Members
47,416
Latest member
LionelQ387

Latest Threads

Top