I want to generate Random alphanumeric characters like ABC-123,ABC-124,ABC-125 and so on... etc as a product Id
Thanks In Advance..
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Sourabh SomaniRank #37 · 35.5K reputationPosted Jul 5, 2017, 3:45 AM EDT
Murli Jadhav93 reputationPosted Jul 5, 2017, 4:41 AM EDT
Sourabh Somani
Sudeep Chourasia Thanks For reply but I want First 3 Letters Constant i.e.ABC is Constant And Next Letters Are numbers
Sudeep Chourasia192 reputationPosted Jul 5, 2017, 3:43 AM EDT
private string RandomNumber(int Size) { string randomno = "abcdefghijklmnopqrstuvwxyz0123456789"; StringBuilder builder = new StringBuilder(); char ch; for (int i = 0; i Size; i++) { ch = randomno[random.Next(0, randomno.Length)]; builder.Append(ch); } return builder.ToString(); }