Returns true if the given character is a whitespace by the XML standard, otherwise false. - Java XML

Java examples for XML:XML Encoding

Description

Returns true if the given character is a whitespace by the XML standard, otherwise false.

Demo Code


//package com.java2s;

public class Main {
    public static void main(String[] argv) throws Exception {
        char c = 'a';
        System.out.println(isWhitespace(c));
    }//from w  w w  . j a  v a  2 s  . c  o  m

    /**
     * Returns <code>true</code> if the given character is a whitespace by the
     * XML standard, otherwise <code>false</code>.
     */
    public static boolean isWhitespace(char c) {
        return c == ' ' || c == '\n' || c == '\r' || c == '\t';
    }
}

Related Tutorials