is Connector Character - Java java.lang

Java examples for java.lang:char

Description

is Connector Character

Demo Code


//package com.java2s;

public class Main {
    public static void main(String[] argv) throws Exception {
        char ch = 'a';
        System.out.println(isConnector(ch));
    }/*from  www  . j a  v  a 2 s  .  co m*/

    public static final char[] connectors = new char[] { '+', '#', '&',
            '.', '_', '-' };

    public static boolean isConnector(char ch) {
        for (char connector : connectors)
            if (ch == connector)
                return true;
        return false;
    }
}

Related Tutorials