how do I rewrite this code without string builder?
function setup() {
createCanvas(600,600);
initializeFields();
var n = 20;
}
function getAlphaNumericString(n) {
// chose a Character random from this String
var AlphaNumericString = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" + "0123456789" + "abcdefghijklmnopqrstuvxyz" + "!@#$%^&*()-_+=`~/[{]}',<.>?";
// create StringBuffer size of AlphaNumericString
var sb = new StringBuilder(n);
for (var i = 0; i < n; i++) {
// generate a random number between
// 0 to AlphaNumericString variable length
var index = int((AlphaNumericString.length * Math.random()));
// add Character one by one in end of sb
sb.append(AlphaNumericString.charAt(index));
}
return sb.toString();
}
function draw() {
}
function initializeFields() {
}
function setup() {
createCanvas(600,600);
initializeFields();
var n = 20;
}
function getAlphaNumericString(n) {
var AlphaNumericString = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" + "0123456789" + "abcdefghijklmnopqrstuvxyz" + "!@#$%^&*()-_+=`~/[{]}',<.>?";
var sb = "";
for (var i = 0; i < n; i++) {
var index = int(AlphaNumericString.length * Math.random());
sb += AlphaNumericString.charAt(index);
}
return sb;
}
function draw() {
eval(sb);
}