Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

import java.util.ArrayList;

import java.util.List;

public class Main {
    public static List<String> splitOnChars(String text) {
        final int stringSize = 300;
        List<String> strings = new ArrayList<>(text.length() / stringSize + 1);
        int index = 0;
        while (index < text.length()) {
            strings.add(text.substring(index, Math.min(index + stringSize, text.length())));
            index += stringSize;
        }
        return strings;
    }
}