From: jihoonl Date: Sun, 1 Nov 2009 06:33:39 +0000 (+0000) Subject: split method added X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=de10a10c3b3f9a39b54bfe9ea4cb0ae9ba3226cf;p=IRC.git split method added --- diff --git a/Robust/src/ClassLibrary/String.java b/Robust/src/ClassLibrary/String.java index 5acb4954..c28c8d4e 100644 --- a/Robust/src/ClassLibrary/String.java +++ b/Robust/src/ClassLibrary/String.java @@ -381,4 +381,25 @@ public class String { } return true; } + + public Vector split() { + Vector splitted = new Vector(); + char[] token = "\n\t "; + int i; + int cnt =0; + + String tmpStr = new String(); + + for(i = 0; i< count; i++) { + if(value[i] == '\n' || value[i] == '\t' || value[i] == ' ') { + splitted.add(tmpStr); + tmpStr = new String(); + }else { + tmpStr += value[i]; + } + } + + return splitted; + + } }