in a sense, the string is an array
use charAt to get the elements:
see last line
let input, button, greeting;
function setup() {
// create canvas
createCanvas(710, 400);
input = createInput();
input.position(20, 65);
button = createButton('submit');
button.position(input.x + input.width, 65);
button.mousePressed(greet);
greeting = createElement('h2', 'what do you want Rick to say?');
greeting.position(20, 5);
textAlign(CENTER);
textSize(50);
}
function greet() {
let text = input.value();
console.log(text.charAt(3)); // !!!!
}