Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
import javax.annotation.Nonnull;

public class Main {
    private static String newline = System.getProperty("line.separator");

    @Nonnull
    public static String normalizeNewlines(@Nonnull String source) {
        return normalizeNewlines(source, newline);
    }

    @Nonnull
    public static String normalizeNewlines(@Nonnull String source, String newlineValue) {
        return source.replace("\r", "").replace("\n", newlineValue);
    }
}