Java Char to DBC ToDBC(char input)

Here you can find the source of ToDBC(char input)

Description

To DBC

License

Open Source License

Declaration

public static char ToDBC(char input) 

Method Source Code

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

public class Main {
    public static char ToDBC(char input) {
        if (input > '\uFF00' && input < '\uFF5F') {
            return (char) (input - 65248);
        }/*from  w w  w  . j a  v  a2s .c o m*/
        if (input == '\u3000') {
            return ' ';
        }
        return input;
    }

    public static String ToDBC(String input) {
        StringBuilder builder = new StringBuilder();
        for (int i = 0; i < input.length(); i++) {
            builder.append(ToDBC(input.charAt(i)));
        }
        return builder.toString();
    }
}

Related

  1. toDbcCase(char src)