List of usage examples for java.lang StringBuffer equals
public boolean equals(Object obj)
From source file:usbong.android.utils.UsbongUtils.java
public static ArrayList<String> extractKanjiPhrasesFromString(String s) { ArrayList<String> output = new ArrayList<String>(); StringBuffer kanjiPhrase = new StringBuffer(); //go through character by character for (int i = 0; i < s.length(); i++) { //Reference: http://www.rikai.com/library/kanjitables/kanji_codes.unicode.shtml; //last accessed: 4 Oct. 2014 //Reference: http://stackoverflow.com/questions/3826918/how-to-classify-japanese-characters-as-either-kanji-or-kana; //last accessed: 4 Oct. 2014; //answer by Jack, Sept. 30, 2010 //while Kanji Char for (int value = (int) s.charAt(i); value >= 0x4e00 && value <= 0x9faf;) { kanjiPhrase.append(s.charAt(i)); i++;/*w w w . j av a 2s .c om*/ value = (int) s.charAt(i); } if (!kanjiPhrase.equals("")) { output.add(kanjiPhrase.toString()); kanjiPhrase.replace(0, kanjiPhrase.length(), ""); } } return output; }