Jump to content

toUpperCase


Little_star

Recommended Posts

Little_star

ola malte, gostaria de saber se alguém me pode explicar como se usa o toUpperCase(). é que eu tenho esta linha de código str=str.substring(0,i+1)+str.toUpperCase(str.charAt(i+1))+str.substring(i+1,str.length()); e dá erro. mesmo quando tento fazer só str.toUpperCase('c'); continua a dar erro...

obrigado

Link to post
Share on other sites

Basta ir ler a documentação do Java para perceber o porquê do erro:

public String toUpperCase()

Converts all of the characters in this String to upper case using the rules of the default locale.

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site you accept our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.