- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to transform List string to upper case in Java?
Let’s first create a List string:
List<String> list = Arrays.asList("David", "Tom", "Ken","Yuvraj", "Gayle");
Now transform the above list to upper case:
list.stream().map(players -> players.toUpperCase())
To display, use forEach():
list.stream().map(players -> players.toUpperCase()) .forEach(players -> System.out.print(players + ""));
The following is an example to transform List string to upper case:
Example
import java.util.Arrays; import java.util.List; public class Demo { public static void main(final String[] args) { List<String> list = Arrays.asList("David", "Tom", "Ken","Yuvraj", "Gayle"); System.out.print("List = "+list); System.out.print("
Uppercase strings = "); list.stream().map(players -> players.toUpperCase()) .forEach(players -> System.out.print(players + "")); } }
Output
List = [David, Tom, Ken, Yuvraj, Gayle] Uppercase strings = DAVID TOM KEN YUVRAJ GAYLE
- Related Articles
- Converting to upper case in Java.
- Convert a C++ String to Upper Case
- Java program to count upper and lower case characters in a given string
- How to convert a string into upper case using JavaScript?
- How to check if a string contains only upper case letters in Python?
- How to convert Lower case to Upper Case using C#?
- How to convert Upper case to Lower Case using C#?
- Moving all Upper case letters to the end of the String using Java RegEx
- How to transform the response to the Java list in Rest Assured?
- MySQL Query to change lower case to upper case?
- C# program to count upper and lower case characters in a given string
- PHP – Make an upper case string using mb_strtoupper()
- Program for converting Alternate characters of a string to Upper Case.\n
- Java String to Lower Case example.
- How to check if a character is upper-case in Python?

Advertisements