T
twink via JavaKB.com
How can i generate a random lowercase letter? And also how can I convert a
String to int?
String to int?
How can i generate a random lowercase letter? And also how can I convert a
String to int?
And also how can I convert a String to int?
Sergey B via JavaKB.com said:You can generate random integer between 0 and 23 and convert it
to the
corresponding lowercase letter.
Sergey said:You can generate random integer between 0 and 23 and convert it to the
corresponding lowercase letter.
http://www.javakb.com/Uwe/Forum.aspx/java-programmer/12886/How-can-I-convert-a-String-to-an-Int
...
I was actually trying to convert the String into its corresponding Int value,
say from "a" to 72
say from "a" to 72
orSergey B via JavaKB.com said:You can simply cast it to a short integer.
short charIndex = (short)myCharacter;
Andrew Thompson said:This is not a help desk.
<http://www.physci.org/codes/javafaq.jsp#homework>
Such beginner questions are better answered at..
<http://www.physci.org/codes/javafaq.jsp#cljh>
And if you are really having difficulty knowing where
to start, check here..
<http://www.physci.org/codes/javafaq.jsp#start>
..as Patricia Shanahan has just the advice you need.
Since you are probably under some misapprehensions about
the Usenet Newsgroup to which you are posting..
<http://www.physci.org/codes/javafaq.jsp#usenet>
In fact, you would benefit from reading the entire FAQ.
Sergey B via JavaKB.com said:You can generate random integer between 0 and 23 and convert it to the
corresponding lowercase letter.
Where does '72' come from?
<http://www.physci.org/codes/char.jsp?char=97>
<http://www.physci.org/codes/char.jsp?char=65>
Rubbish, you have no authority here.
Andrew Thompson said:This is not a help desk.
<http://www.physci.org/codes/javafaq.jsp#homework>
Such beginner questions are better answered at..
<http://www.physci.org/codes/javafaq.jsp#cljh>
And if you are really having difficulty knowing where
to start, check here..
<http://www.physci.org/codes/javafaq.jsp#start>
..as Patricia Shanahan has just the advice you need.
Since you are probably under some misapprehensions about
the Usenet Newsgroup to which you are posting..
<http://www.physci.org/codes/javafaq.jsp#usenet>
In fact, you would benefit from reading the entire FAQ.
tell you what "Kerry", for the next month you can answer every lame newbie
question posted , without ever complaining.
Including the ones :
1.can you do my homework for me.
2. can you teach me java without me actually doing any work.
otherwise STFU.
Tris said:Ahem! As the founding member of the "Don't Forget About 'y' and 'z' at the End of the Alphabet" society I must
formally lodge a complaint. Just a reminder that the next meeting is to be held at the:
Joan said:or
int i = "a".charAt(0)
Thomas said:You are assuming the locale is not set to greek or something weird and
foreign.
Tom Hawtin
Raymond DeCampo said:Is this a joke? Or do you really think that the code you
posted is better than that you quoted?
Ray
Joan said:If you mean "short charIndex = (short)myCharacter;"
it does not meet the requirements.
The OP says for "string" not "char"
If you put myString for myCharacter, it doesn't compile.
Raymond DeCampo said:OK, I misunderstood. I think it would have been clearer if you
used a variable to represent the String in your example,
because as it stands, it looks ridiculous.
Ray
I think we should file a RFE with Sun to get
Locale.getNumberOfLowercaseLetters() added.
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.