Skip to content

Instantly share code, notes, and snippets.

View tamtam180's full-sized avatar

tamtam180 tamtam180

View GitHub Profile
@tamtam180
tamtam180 / gist:2925376
Created June 13, 2012 17:27 — forked from komiya-atsushi/gist:2925087
なんか構造が美しくないのでリファクタしたい・・ こんなのはどうかな?(komiya)
public static List<String> tokenize(String str) {
if (str == null || str.isEmpty()) {
return Collections.emptyList();
}
ArrayList<String> tokens = new ArrayList<String>();
int i = 0;
char[] chars = str.toCharArray();
while (i < chars.length) {