M
M
Monti12018-03-16 20:48:00
Java
Monti1, 2018-03-16 20:48:00

How to make the first character of a string be capitalized?

Let's say the user enters his name with a small letter, how to implement it to display his name with a capital letter?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
Kirill Romanov, 2018-03-16
@Monti1

string.substring(0, 1).toUpperCase() + string.substring(1);

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question