Here you can find the source of truncateType(String s)
private static String truncateType(String s)
//package com.java2s; /*//from w ww .j a v a2s. co m The contents of this file are subject to the Mozilla Public License Version 1.1 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.mozilla.org/MPL. The Original Code is the DoPE Pharmacoepidemiology Toolbox. The Initial Developer of the Original Code is the Brigham and Women's Hospital Division of Pharmacoepidemiology. Contributor(s): Jeremy A. Rassen <jrassen@post.harvard.edu> */ public class Main { private static String truncateType(String s) { if ((s == null) || (s.length() == 0)) return ""; String[] stringTokens = s.split("\\|"); return (stringTokens[0].toUpperCase()); } }