+ 2

How can I write a code in java that gets human inputs (using String datatype) and converts it to an uppercase or lowercase?

Getting inputs and converting it to uppercase or lowercase or both simultaneously..

12th Feb 2017, 12:19 AM
Okehi Usman
Okehi Usman - avatar
5 odpowiedzi
+ 11
What language?
12th Feb 2017, 12:36 AM
David Sebastian Keshvi Illiakis
David Sebastian Keshvi Illiakis - avatar
+ 8
In Java: import java.util.Scanner; public class Program { public static void main(String[] args){ Scanner scan = new Scanner(System.in); String s = scan.next().toUpperCase(); System.out.println(s); } } You can use toLowerCase() instead of toUpperCase().
12th Feb 2017, 1:14 AM
Jafca
Jafca - avatar
12th Feb 2017, 1:31 AM
Yanothai Chaitawat
Yanothai Chaitawat - avatar
+ 1
Java lang...
12th Feb 2017, 10:09 AM
Okehi Usman
Okehi Usman - avatar
+ 1
Thanks Jafca... It worked
12th Feb 2017, 2:23 PM
Okehi Usman
Okehi Usman - avatar