Here you can find the source of randomCharacter(String availableValues)
Parameter | Description |
---|---|
availableValues | a parameter |
public static String randomCharacter(String availableValues)
//package com.java2s; /*/* www . j a v a 2s . c o m*/ * soapUI, copyright (C) 2004-2011 eviware.com * * soapUI is free software; you can redistribute it and/or modify it under the * terms of version 2.1 of the GNU Lesser General Public License as published by * the Free Software Foundation. * * soapUI is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without * even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU Lesser General Public License for more details at gnu.org. */ public class Main { /** * returns one random character from specified availableValues string * * @param availableValues * @return character */ public static String randomCharacter(String availableValues) { int position = (int) (Math.random() * availableValues.length()); return availableValues.substring(position, position + 1); } }