How to Get Second Word from String Using Java?

Friends, today I will tell you through this blog how you can get his second word from any string through java. Let’s try to understand through java.

Get Second Word from String Using Java, Extract Second Word from String by Java, How to Fetch Second Word from String in Java

You have written the code of java below in a very easy way. Through which you can very easily samajh how you can get his second word from string via java.

String str = "Experts PHP Technology Pvt Ltd.";
String[] sp = str.split(" ");
System.out.println("second word is " + sp[1]); //PHP