reverse string and uppercase first latter using java
Categories: Java
Reverse string and uppercase first latter using java
/* reverse string and uppercase first latter */
import java.util.*;
import java.util.stream.*;
public class ReverseStringanduppercaseFirstLatter {
public static void main(String []args) {
// System.out.println("Hello, World!");
String str="hello how are you";
//String strTemp="";
String ss=Arrays.stream(str.split(" ")).map(a -> a.substring(0,1).toUpperCase()+a.substring(1)).collect(Collectors.joining());
System.err.println(ss);
}
}
Using Stream API