Here you can find the source of countLines(String data)
public static Integer countLines(String data)
//package com.java2s; /*/* w ww . ja v a2 s .co m*/ * Copyright (c) Mirth Corporation. All rights reserved. * * http://www.mirthcorp.com * * The software in this package is published under the terms of the MPL license a copy of which has * been included with this distribution in the LICENSE.txt file. */ public class Main { /** * Counts the number of lines in this String. */ public static Integer countLines(String data) { if (data == null) { return null; } return data.split("\r\n|\r|\n").length; } }