the string in a variable called inputStr and the integer in a variable called inputInt. Pass inputStr
and inputInt to a method called splitter. The splitter method splits the input string by exactly
inputInt characters at a time and prints each in a line. Only the splits that have exactly inputInt
characters should be printed. Consider the following 2 Note that in example 2, the last 2
characters ( le) are not printed since they don\'t have 6 characters.
Solution
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
/**
*
* @author CheggExpert
*/
import java.util.Scanner;
public class Split {
public static void splitter(String inputStr,int inputInt)
{
String str = \"\";
int len = inputStr.length();
if(len>=inputInt)
{
for(int i=0;i