Java String Ends With endsWithNewline(String string)

Here you can find the source of endsWithNewline(String string)

Description

ends With Newline

License

Open Source License

Declaration

public static boolean endsWithNewline(String string) 

Method Source Code

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

public class Main {
    public static boolean endsWithNewline(String string) {
        if (string.isEmpty()) {
            return false;
        }/*  w w  w.jav  a2 s. c  o  m*/

        final char character = string.charAt(string.length() - 1);
        return character == '\r' || character == '\n';
    }
}

Related

  1. endsWithIgnSpace(String s, String ending)
  2. endsWithIllegalWindowsChar(String filename)
  3. endsWithIndex(String[] suffixes, String propertyName)
  4. endsWithLineSeparator(final CharSequence msg)
  5. endsWithName(String subject, String endName)
  6. endsWithOne(final String src, final String[] dest)
  7. endsWithOne(String src, String... dest)
  8. endsWithOneOf(String value, String... ends)
  9. endsWithoutPathSeparator(final String path)