se fai

codice:
int size = str.size();
ottieni la lunghezza dell'oggetto string.