jweinst1
9/30/2015 - 6:29 PM

returns a substring equal to one half of the first str.

returns a substring equal to one half of the first str.

class Main {
  public static void main(String[] args) {
    System.out.println(halfstring("wopple"));
  }
  public static String halfstring(String x) {
      int size = x.length();
      size = size/2;
      String result = x.substring(0, size);
      return result;
  }
}