Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
//License from project: Open Source License 

public class Main {
    /**
     * Turn a string into a note's title and text
     * @param value
     * @return
     */
    @SuppressWarnings("nls")
    public static String[] fromNoteField(String value) {
        String[] result = new String[2];
        int firstLineBreak = value.indexOf('\n');
        if (firstLineBreak > -1 && firstLineBreak + 1 < value.length()) {
            result[0] = value.substring(0, firstLineBreak);
            result[1] = value.substring(firstLineBreak + 1, value.length());
        } else {
            result[0] = "";
            result[1] = value;
        }
        return result;
    }
}