Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*
   * @(#)String0.java		Created at 15/4/12
   * 
   * Copyright (c) azolla.org All rights reserved.
   * Azolla PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. 
   */
  package org.azolla.l.ling.lang;
  
The coder is very lazy, nothing to write for this class

Author(s):
sk@azolla.org
Since:
ADK1.0
 
 public class String0
 {
     public static final String SLASH = String.valueOf(.);
     public static final String POINT = String.valueOf(.);
     public static final String UNDERLINE = String.valueOf(.);
     public static final String EQUAL = String.valueOf(.);
 
     public static final String EMPTY = "";
 
     public static final String SUCCEED = "Succeed";
     public static final String FAILED = "Failed";
 
     public static final  String                  ALPHABET                = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
 
     private static final HanyuPinyinOutputFormat hanyuPinyinOutputFormat = new HanyuPinyinOutputFormat();
 
     static
     {
     }
 
     public static String pinyin(String chineseString)
     {
         StringBuffer rtnStringBuffer = new StringBuffer();
         String[] pinyinStringArray = null;
         char pinyinChar = .;
 
         for (int i = 0; i < chineseString.length(); i++)
         {
             pinyinChar = chineseString.charAt(i);
 
             if (' ' == pinyinChar)
             {
                 rtnStringBuffer.append(.);
             }
             else if (Char0.isAlphabet(pinyinChar))
             {
                 rtnStringBuffer.append(pinyinChar);
             }
             else
             {
                 try
                 {
                     pinyinStringArray = PinyinHelper.toHanyuPinyinStringArray(pinyinChar);
                     if ((null != pinyinStringArray) && (pinyinStringArray.length > 0))
                     {
                         rtnStringBuffer.append(pinyinStringArray[0]);
                     }
                     else
                     {
                         rtnStringBuffer.append(.);
                     }
                 }
                 catch (BadHanyuPinyinOutputFormatCombination e)
                 {
                     Log0.warn(String0.classe.toString(), e);
                 }
             }
         }
 
         return rtnStringBuffer.toString().toLowerCase();
     }
 
     public static String nullOrEmptyTo(String stringString to)
     {
         return Strings.isNullOrEmpty(string) ? to : string;
     }
 
     public static String amp(String string)
     {
         return string.replaceAll("&","&amp;");
     }
 
     public static String lt(String string)
     {
         return string.replaceAll("<","&lt;");
    }
    public static String gt(String string)
    {
        return string.replaceAll(">","&gt;");
    }
    public static String quot(String string)
    {
        return string.replaceAll("\"","&quot;");
    }
    public static String html(String string)
    {
        return String0.quot(String0.gt(String0.lt(String0.amp(string))));
    }
New to GrepCode? Check out our FAQ X