Answered You can hire a professional tutor to get the answer.
Write a method that takes a String as input and returns a String containing the middle character of the String if the length of that String is odd.
Write a method that takes a String as input and returns a String containing the middle character of the String if the length of that String is odd. If the length of the String is even, your method should return the middle two characters. For example, if the input String is "Hello" the method should return "l" and if the input String is "Worlds" the method should return "rl". In addition, write a main method that tests your method for a variety of String values.