Java String Truncate truncateType(String s)

Here you can find the source of truncateType(String s)

Description

truncate Type

License

Mozilla Public License

Declaration

private static String truncateType(String s) 

Method Source Code

//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());
    }
}

Related

  1. truncateText(String text, int maxCharLength)
  2. truncateTime(String dateString)
  3. truncateToFirstLine(String string)
  4. truncateToLength(String inputString, int truncateLength)
  5. truncateToMaxLen(String input, int len)
  6. truncateType(String type)
  7. truncateUri(String uri)
  8. truncateUrl(String url)
  9. TruncateUrlPage(String strURL)