I want to generate an unique 4 digit random number. This is the below code what I have tried:
Code for generating random number
//Ge
0 is the same as 0000.
241 is the same as 0241.
You could format the integer to a string with a leading zero.