Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

write a code to print second last word of input string

String string = "Hai,Hello,How,are,";
String[] bits = string.split(",", -1);
 ↓
bits[]…{ "Hai","Hello","How","are","" }
bits[bits.length-2]…"are"
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #write #code #print #word #input #string
ADD COMMENT
Topic
Name
1+5 =