• Post Reply Bookmark Topic Watch Topic
  • New Topic

genrating Random String  RSS feed

 
rai talari
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi I want to genrate random string from a String array can u help me regarding this
 
marc weber
Sheriff
Posts: 11343
Java Mac Safari
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, I'm sure we can help you -- if you tell us a little more about what you're doing and show us how far you've gotten.
 
Chengwei Lee
Ranch Hand
Posts: 884
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
To help you get started, take a look at the API for Math.random() and see how you could use it. What does your String array stores?
 
rai talari
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thak u for your intrest .
i am validating the userform containing email for that i want to show some protype email addresses of form user@hostname .I am keeping 4 email addresses in string array and i want to randomly generate them to the user.
eagerly waiting for your response
 
marc weber
Sheriff
Posts: 11343
Java Mac Safari
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by rai talari:
...I am keeping 4 email addresses in string array and i want to randomly generate them to the user...

So if you already have a String[] of length 4, then all you really need to do is pick a random int from 0 to 3, right?
 
rai talari
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thank you
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!