convert string other case

M

mf.alroby

hellow all,

i would ask are there function

this function can convert string other case ??

if string will be upper case the function convert it to lower case

or if string will be lower case the function upper it to lower case

thanks
 
A

Arne Vajhøj

i would ask are there function

this function can convert string other case ??

if string will be upper case the function convert it to lower case

or if string will be lower case the function upper it to lower case

No such method exist in standard Java library.

But the String and Character classes has toUpperCase/
toLowerCase/isUpperCase/isLowerCase methods that you
can use to achieve this.

Arne
 
R

Roedy Green

i would ask are there function

this function can convert string other case ??

if string will be upper case the function convert it to lower case

or if string will be lower case the function upper it to lower case

String.toUpperCase
Character.toUpperCase

It seems to be this is exactly where you would expect to find them,
with the names you would expect, a fortunate event in Java. Where did
you expect to find such functions, or did you just assume you would
have to roll your own?
 
L

Lord Zoltar

String.toUpperCase
Character.toUpperCase

It seems to be this is exactly where you would expect to find them,
with the names you would expect, a fortunate event in Java. Where did
you expect to find such functions, or did you just assume you would
have to roll your own?

I understood the question as asking if there's a swapCase function
that will change all lower-case letters to upper-case letters and vice-
versa. I don't think such a function exists, but I don't think it
would too hard to write one.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,432
Messages
2,571,680
Members
48,796
Latest member
Greg L.

Latest Threads

Top