Here you can find the source of toChar(String delimiter)
public static char toChar(String delimiter)
//package com.java2s; //License from project: Open Source License public class Main { public static char toChar(String delimiter) { if (delimiter.length() == 1) { return delimiter.charAt(0); } else if (delimiter.toLowerCase().startsWith("0x") && delimiter.length() == 4) { return (char) Integer.parseInt(delimiter.substring(2), 16); } else if (delimiter.toLowerCase().startsWith("\\0") && delimiter.length() == 4) { return (char) Integer.parseInt(delimiter.substring(2)); } else if (Character.isDigit(delimiter.charAt(0))) { return (char) Integer.valueOf(delimiter).intValue(); } else {/*from w ww. j a v a2 s . c o m*/ throw new IllegalArgumentException("Unrecognized delimiter format:" + delimiter); } } }