Java tutorial
//package com.java2s; public class Main { public static char getFirstChar(String text) { if (text != null && text.length() > 0) { return text.charAt(0); } return (char) 0; } }