C'è un modo in Java per creare una stringa con un numero specificato di un carattere specificato? Nel mio caso, avrei bisogno di creare una stringa con 10 spazi. Il mio codice attuale è: StringBuffer outputBuffer = new StringBuffer(length); for (int i = 0; i < length; i++){ outputBuffer.append(" "); …
We use cookies and other tracking technologies to improve your browsing experience on our website,
to show you personalized content and targeted ads, to analyze our website traffic,
and to understand where our visitors are coming from.
By continuing, you consent to our use of cookies and other tracking technologies and
affirm you're at least 16 years old or have consent from a parent or guardian.