class TextUtils {

    public static String splitSafe( String string, String separator, int index )
    {
        if ( string == null )
        {
            return null;
        }

        String[] split = string.split( separator );

        if ( index >= 0 && split.length > index && split[index] != null )
        {
            return String.valueOf( split[index] );
        }

        return null;
    }

}