Question: Write a Java class called StringFun that: - Takes as a command line argument any number of strings (if you want spaces in your String
Write a Java class called StringFun that:
- Takes as a command line argument any number of strings (if you want spaces in your String you have to use quotes around the argument, for example, This string has spaces in it.
- Performs all 9 of the methods listed below.
- Prints out the results of each method.
1) s.length()
2) s.equals(otherString)
3) s.substring(startIndex, endIndex)
4) s.trim()
5) s.indexOf(subString)
6) s.lastIndexOf(subString)
7) s.charAt(index)
8) s.toLowerCase()
9) s.toUpperCase()
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
