Android examples for java.util:Random
append Random Space
import java.util.Random; public class Main{ public static String appendRandomSpace(String string) { Random random = new Random(); int randomNum = random.nextInt(50); for (int index = 0; index < randomNum; index++) string = string + index;/*from w w w . j av a2 s . c o m*/ return string; } }